RMMV How do you make skills dependent on currently applied states

In the game I'm making I'm trying to make it so that a certain skill can only be used if the opponent has a certain state currently applied. For example, one of my hero characters has a skill which adds a state to the user called "Illusory Copies" which makes them more able to evade attacks. One of the enemies has a skill (Primal Instincts) which removes this state but I'd like them to use it only when the hero character has the Illusory Copies state applied. Currently they'll use it regardless of whether or not the state is applied. How would I go about doing this? Is there a way that isn't script intensive or makes use of an easy to use plug-in?


I hope I've managed to explain this well enough.


Here are some screenshots which I hope will help. I'm still pretty new to RPG Maker.

Spoiler
Screenshot 1 - Illusory Copies.pngScreenshot 2 - Primal Instincts.pngScreenshot 3 - Enemies.png
If a skill should only be available to an actor when a certain state is applied, then have that state add the skills by trait and do not add them on the class. That way they will only be available if the state is applied.


If you require the level condition for the skills, do it the other way around: add the skills by the level list on the class, but add the skill type only by state.


If you want the same mechanism for an enemy, you have to work with attack pattern conditions as enemies neither use skill types no learned skills.
If a skill should only be available to an actor when a certain state is applied, then have that state add the skills by trait and do not add them on the class. That way they will only be available if the state is applied.


If you require the level condition for the skills, do it the other way around: add the skills by the level list on the class, but add the skill type only by state.


If you want the same mechanism for an enemy, you have to work with attack pattern conditions as enemies neither use skill types no learned skills.



Ahhh, I see. It would be a mechanism for the enemy as at this point it's only the enemies that possess the "Primal Instincts" skill. What exactly would I have to do with the attack pattern conditions? I saw one labelled state that I thought would work but it's referring to the state being applied to the enemy itself rather than the actor.


The "Illusory Copies" skill is a skill used by the actor which applies the state to themselves. Primal Instincts is supposed to take away this state from the actor but I was hoping I could get the enemy only to use it when the Actor has used the Illusory Copies skill so they aren't wasting their turn.


I hope I'm explaining this alright.

Spoiler
Screenshot 4 - Primal Instincts.png
I just thought I should say that I've found a solution to my problem and I should post it here in case anyone's looking for something similar. I found that using Yanfly's Battle AI Core plugin does what I need to do as it has a couple of sections of code which determine an actor or foe's moveset by conditions to be fulfilled and one of these is currently applied states.


And thank you very much, Andar, for your help. I will keep your advice in mind.

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-how-do-you-make-skills-dependent-on-currently-applied-states.64305/