Skill that adds a state during the start of the turn, before the action.

I have an idea for a skill that protects the user from stagger when the skill is chosen (before the user even uses the attack), then attacks and inflicts stagger.


The idea is like this.


Actor 1 chooses Heavy Impact.


Actor 2 chooses random skill.


(Buff is applied here, after all actors have chosen their actions)


Boss attacks with a fast skill, inflicting stagger to the whole party. Actor 2 loses his action. Actor 1 is protected.


Actor 1 uses heavy impact. Boss is staggered.


Boss loses his other attacks this turn.


Do I need any plugins for this? If so, and if not, how could I achieve this?
Yanfly's buffsstatescore
How?


The state has to be applied before the attack, and after all attacks and locked in. Yanfly's buff and states core allows the modification of states to have custom effects when applied and in various other timing.


'When applied'


The problem is how to 'apply' it.
Maybe this one?


<Custom Initiate Effect>


user.addState(x)


</Custom Initiate Effect>


Or perhaps try Yanfly's instant cast plugin?

Original thread: https://forums.rpgmakerweb.com/threads/skill-that-adds-a-state-during-the-start-of-the-turn-before-the-action.57498/