Question about AI

Hey, I want to make custom AI for battle


Is there a ways to make the AI cast Power up buff only to single enemy.


for example there are 2 mage and 1 swordsman,


the mage will cast power up only to swordsman as long as the swordsman doesn't have Power up buff state on him.


tried with Yanfly AI and it make me stress.


the logic or pseudo code i made.


Conditional Branch = $gameTroop.members()[Sworsman].state(PowerUp) === true;


Script $gameTroop.members.forceAction(PowerUp, $gameTroop.members()[Swordsman]);


or is there a way to make conditional branch which checked if actor or gameTroop affected by PowerUp buff or not,


because RMMV Script call only have Change State not Checking State


Someone help me please...

Original thread: https://forums.rpgmakerweb.com/threads/question-about-ai.64935/