Yanfly Action Sequences and "cannot move" State Restrictions

Hello all! After a bunch of messing around with Yanfly's action sequences in my project(and starting a new project), I noticed that when an actor has a state that gives them the "Cannot Move" restriction, as long as they are affected by that state, they no longer responded to movement commands with action sequences.

This is an issue, as a lot of my skills emulate a "psychic" character that tosses enemies around and it visually breaks the effect when a stunned enemy is glued in place but still takes the damage.

I'm unsure if this is something to do with Yanfly's plugin OR if it's something built into the MV engine itself, but any help would be appreciated! Or if it was possible to emulate a stunned state another way,I'd be cool with that too!
Hello, I guess you could try to work it around with something like this:

<target action>
if target.isStateAffected(X)
remove state X: target
add state Y: target
end

...Your sequence

if target.isStateAffected(Y)
remove state Y: target
add state X: target
end
</target action>

State X would be a state with the "cannot move" restriction and state Y would be a fake state only to retain that the target was affected by state X and give it back at the end of the sequence (or you could use a variable instead).
@TSR
Record the number of rounds in the true state and apply this number of rounds when setting the false state.
At the end of the action, when the true state is restored, the continuous round is also restored.
How to write it?
-----------
This method is not very good, if this state also occurs during the attack action, it will be added to the target again.
In this case, if you need to move the target multiple times in an action sequence, you need to repeatedly judge
Is there a way to remove only the cannot move attribute?

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-action-sequences-and-cannot-move-state-restrictions.117140/