For JS on the client side to be able to behave in the way you describe, it has to be informed by the server about the unskippable parts. Thus browser extensions are informed as well, and can take action correspondingly. In the worst case, they’ll behave as YouTube’s new hold screen does now.
Anything that JS on the client can do is also under control of browser extensions. We are talking about YouTube’s options under that constraint.