KeyboardEvent.isComposingで変換中か判定したらいい

<input id="test">

const elm = document.querySelector("#test");
elm.addEventListener("keyup",(e)=>{
if(!e.isComposing){
elm.value =
e.target.value.replaceAll(";","1")
}
})