Making moves miss if hit?

I want to have a focus move that fails if the user is hit between casting and their next turn. This is pretty much the bare minimum for the move that I'm willing to implement (even temporarily), but I would also like a few other, more optional features.

1) If the move fails the message "\N[n] was distracted." pops up.
2) The user can't attack on their next move, to prevent possible future exploits (such as casting a sure block (not implemented, but just in case) with one character and focus with the other, then just using a really powerful move with high tp cost)

those features are pretty much just optimisation/qol, and as such aren't really necessary, but would be nice. any tips/advice?
your main problem here is that all skills are executed independently, and no result is stored by default.

so you'll either have to replace most of the battlesystem with a different one that supports the features you want, or get really tricky.

One way to handle this is to have the first skill apply a special state to the user. That state needs to be removed by damage and have all effects you want, including sealing or adding skills for the next turn (duration of state needs to be 2 at minimum, because 1 turn is only to the end of this turn, ending before next action selection)

If the other skill to be used next turn is enabled by the state, the player can only select that one if the state is still active and not countered by damage.

if the other skill is not linked to the state, you can use damage coding: begin with an if checking if the state is still there and have different results based on yes or no.

Original thread: https://forums.rpgmakerweb.com/threads/making-moves-miss-if-hit.138186/