Yanfly Battle A.I. Core - More than 1 Condition?

Does anyone know how to set up Yanfly's A.I. so that battlers have to fulfill more than one condition to use a skill?


Right now I have:


<AI Priority>


Troop Alive Members >= 2: SKILL 306, Highest HP


</AI Priority>


Basically, as long as the troop has 2 or more battlers, this enemy will use Taunt. But, the problem is, is that he will ALWAYS use taunt as long as there are 2 or more battlers. I want to set it up to check for "Troop Alive Members" AND "State !==", then I can also check if the battler already has Taunt on (so as to not use it again and go to another skill).



Is this possible?
It should be possible to add an "and" statement to this.  Try this:


<AI Priority>


Troop Alive Members >= 2 && target.notState(Taunt State ID#): SKILL 306, Highest HP


</AI Priority>


I saw a piece of code like this in the Yanfly AI Core page, so I'd imagine that it would work.
Okay, I wrote it out like this:


<AI Priority>


Troop Alive Members >= 2 && State !== State 36: SKILL 307, Highest HP


</AI Priority>


I've used both Conditions before and they've worked great... but it seems combining them with "&&" doesn't do the trick. I got "Syntax Error. Unexpected Number."


So, I tried using the idea above. I wrote out:


<AI Priority>


Troop Alive Members >= 2 && target.notState(State 35): SKILL 306, Highest HP


</AI Priority>


...And I got the exact same error. Any other ideas?
Okay, I wrote it out like this:


<AI Priority>


Troop Alive Members >= 2 && State !== State 36: SKILL 307, Highest HP


</AI Priority>


I've used both Conditions before and they've worked great... but it seems combining them with "&&" doesn't do the trick. I got "Syntax Error. Unexpected Number."


So, I tried using the idea above. I wrote out:


<AI Priority>


Troop Alive Members >= 2 && target.notState(State 35): SKILL 306, Highest HP


</AI Priority>


...And I got the exact same error. Any other ideas?



The problem with the second one is that with the state part of the conditional, you put the word State in the parentheses before the State ID.  Try putting only the ID number.
It says "Target is not defined" when I tried with just 35 instead of State 35. I don't know JS, but I think this mean the script doesn't know what "target" is supposed to be? I'm not sure what else to try.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battle-a-i-core-more-than-1-condition.64362/