any way I can make an enemy always use a specific skill but only when an actor has a specific state

Hello! Is there maybe any way to make an enemy always use a skill whenever an actor has a specific state but never use the the skill unless an actor has this specific state. I'm trying to create a boss that will instantly remove a shield state the moment it is afflicted onto an actor by using specific skill. I've gotten similar results using some plugins but I specifically want this skill to always be used whenever the state is on an actor and never used otherwise. Is there any methods of implementing this?
if you use Yanfly's Battle A.I. plugin you can have the enemy do exactly that
Hmm. You could also let your shield state (If you have a state for that) turn on a switch with a little notetag, then put said switch as the condition for the skill. Priority 9 and that's about it.

Something like:
Code:
<Custom Apply Effect>
$gameSwitches.setValue(switchId, true);
</Custom Apply Effect>

<Custom Leave Effect>
$gameSwitches.setValue(switchId, false);
</Custom leave Effect>
Should do the trick. (Needs Yanfly's Buffs & States core, but I find this much easier to handle than diving into the ai plugin.)
I wrote this up for doing something similar.


You would just need to have the state be on the player and boss, and then have the boss remove that state on self and player by sealing/adding abilities.

Edit: I just realized you are using MV, and this is for MZ. I’m not sure it will work, but worth a shot.

Original thread: https://forums.rpgmakerweb.com/threads/any-way-i-can-make-an-enemy-always-use-a-specific-skill-but-only-when-an-actor-has-a-specific-state.171076/