Help needed - sp-slider for current layer Opacity

Hello Everyone,
New to the forum, and new to developing PS plugins. Have have created a working plugin with buttons, but now I am trying to incorporate sliders.
Currently trying to create a sp-slider to control the current selected layer’s opacity.
I have no problem creating the slider in the html so it appears in my plugin panel, but I can’t seem to get it coded in the js to make it actually function.
For my buttons I learned / figured out async functions and click events with event listeners, but I just can’t seem to figure out how to make a slider work.
Any help with the basic js code for the event listener and function, or point in the right direction is appreciated.
I have found several other topics that seem to address this but can’t seem to implement the code in those topics and make it work.

I also have this doubt. Accompanying…

Have you tried doing it this way?

html:

<sp-slider id="mySlider" min="0" max="100" value="100">
    <sp-label slot="label">Opacityl</sp-label>
</sp-slider>

js:

document.querySelector("#mySlider").addEventListener("input", evt => {
   core.executeAsModal(async () => {	
      app.activeDocument.layers[0].opacity= evt.target.value;
   })
})

@PS-fxrios
For me it works fine
but it creates too many story levels
you could add a pause story

I have doubt how to put the parameters in the JS to change the timeline frameRates