MV Yanfly Enevy Ai. Check for party buffs

For enemy AI how can you have them check for an actor buff?
I got the following but it seems I'm missing something.

Eval $gameActors.actor(1)._buffs[3] === 0: Skill 12, Random

Thanks.
That will check whether actor ID 1 has no buffs or debuffs to DEF.
That will check whether actor ID 1 has no buffs or debuffs to DEF.
additionally, if it were changed to "Eval $gameActors.actor(1)._buffs[3] > 0" wouldnt that make the AI only consider using that skill if actor 1 had that buff? like it wouldnt necessarily use that skill on that actor. iirc Eval inside the AI plugin doesnt actually affect the available targets like State or Param does, just determines if the skill can be used at all. actor 1 could have that buff and then the enemy can whack actor 2 with skill 12, which i dont think is what theyre necessarily going for. if it is, then great

I tend to make my skills like that with selection control plugin tags so that the skill in general can only ever be used when a condition like the target having buff 3 is true
additionally, if it were changed to "Eval $gameActors.actor(1)._buffs[3] > 0" wouldnt that make the AI only consider using that skill if actor 1 had that buff?
Yes, but the OP gave zero information on what they actually want to be doing. So I simply confirmed what their code currently does.

like it wouldnt necessarily use that skill on that actor.
Correct, as far as I recall the Battle A.I. Core does not provide a way to force who the skill targets - you'd have to use it in conjunction with the Selection Core for that.

But, again, I have no idea what the OP is trying to accomplish.
I have no idea what the OP is trying to accomplish.

To give more context I want an enemy to check if the party has 2 levels of defense buffs and cast a debuff spell. The original context is just for testing.
I had some issues getting this working consistently as setting the skill to be 1(basic attack) would have it sometimes work and setting it to anything else would always cause it to fail.
The enemy also doesn't have basic attack available in their normal skill pool so it's not coincidently calling the attack either.
I had some issues getting this working consistently as setting the skill to be 1(basic attack) would have it sometimes work and setting it to anything else would always cause it to fail.
unless you added more conditions than what you had above, never set your enemy's AI level and left it to default (80?), or made your other skills unusable somehow like giving them mp costs without giving that enemy mp, the line should work whenever the condition is true.
Ah, no your right.
For whatever reason this was the only enemy in the game that had AI level to 30. No idea why that was. But that solved my issue. Thanks

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-enevy-ai-check-for-party-buffs.162606/