MV Yanfly Battle AI Core, help with a condition

Guys, can you help me with a check using the AI Core? I want a debuff spell (affects all actors) to only be usable when no member of the party (alive) is affected by x state.

Thanks!

EDIT:
Solved. Using this eval allows me to do exactly what I wanted.

JavaScript:
$gameParty.aliveMembers().every(function(m){return !m.isStateAffected(x);})
Guys, can you help me with a check using the AI Core? I want a debuff spell (affects all actors) to only be usable when no member of the party (alive) is affected by x state.

Thanks!

EDIT:
Solved. Using this eval allows me to do exactly what I wanted.

JavaScript:
$gameParty.aliveMembers().every(function(m){return !m.isStateAffected(x);})
Thanks for showing the answer. I was curious on this.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battle-ai-core-help-with-a-condition.180613/