Yanfly Battle AI Question

Is there a way to make it so if an enemy has a state already applied to them, they will do a specific other action? Or at least not cast the skill that applies that state to them again?

From what I can tell the only checks you can do are if the target passes some check, apply some skill to that target. I can't figure out a way to make it check one battle member, and target a different battle member.
Since you're asking for help with a plugin, I've moved this to Plugin support for you.
State !== State 10: Skill, Target

It checks if the target has the state in question. If it doesn't, it's a valid argument.
You can do this in the editor too...Just redo the attack pattern with a priority that is 3 higher than your default
You can do this in the editor too...Just redo the attack pattern with a priority that is 3 higher than your default

I thought the priorities just made it more likely or less likely to cast. How exactly do those work then?
State !== State 10: Skill, Target

It checks if the target has the state in question. If it doesn't, it's a valid argument.

I don't want to check a target and then apply a skill to that same target, I want to check: IF user has state X, do skill Y on target enemy.
Kinda/sorta, but the priorities are set up so that only skills that are 1 or 2 lower than the highest skill which is valid will ever activate. So if you use the default of 5, that means that any skill with a priority lower than 3 will never run. So what you could do is use the default of 5 for your usual pattern, then set a new pattern with a priority of 10 (or 9 or 8) which only runs when the enemy has that state, and will not include the option to use the skill which reapplies that state.

Also please don't double post, which is posting 2x in a row on the board. Instead use the edit button to put all the replies in one spot. I know if you hit quote it defaults to a new post, so best use @ instead so they know you are replying to them.
Alright thanks for the help.
I'll share some related wisdom with you:

Code:
state === Row-F
//When checking for a state without eval,
//it checks the target scope of the skill.
//in question.

Eval !user.isStateAffected(13)
//Check's specifically if the user
//lacks a state.

Eval (!user.isStateAffected(33) || !user.isStateAffected(33))
//Check if the user of skill lacks either
//of these states.

Eval (State(A) || State(B)) +++ Random 40%
//Evals can be combined with the '+++' conditions if they are put in brackets.
//This checks if the target has either State A or State B, AND triggers with a
//conditional 40% random chance

Eval user.hpRate() === 1
//Checks to see the user's HP rate.
//(1 is 100%, 0.5 is 50%, etc.)

Important:
Eval target.isStateAffected(13)
//This WON'T work. You can't check a target
//in an eval as the target isn't yet defined.
Ok I swear I had already tried user.isStateAffected and it didn't work but I tried again after your post and now it's working.

Another question related to this kind of thing: if I want to have an enemy do a skill every X number of turns, what's the best way to do so? I've tried using a variable that's changed by a common event called by the skill cast by the enemy in question, but that means I need an extra skill just for calling that event any time I want that skill to be only cast on certain turns. The way I'm using now which is super messy is just:
user.turnCount === 1 || user.turnCount === 3, etc.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battle-ai-question.93631/