MZ Battle AI target conditions (VisuStella)

Hi there,

I'm using VisuStella's Battle AI plugin. When selecting a target for a skill using text in the skill's note box, the syntax is:
Code:
<AI Target: type>

In "type" you put a premade keyword, such as "Highest HP." However, if two potential targets both meet this condition, it randomly selects one of the targets. How can you make it so, in a "tie," there is either A: an additional condition check (e.g., "Lowest ATK"), or B: a consistent target? There are many cases where multiple targets will fit the same "type" and proper AI would allow further differentiation between targets. Since this is an AI plugin, I assume this should be possible.

I know lots of the people use this plugin, so I'd appreciate any help + solutions. Thank you!
Here's a workaround:

Use Battle Core's JS Targets notetag to make the checks in the necessary skills and switch the target to the one you want.
Here's a workaround:

Use Battle Core's JS Targets notetag to make the checks in the necessary skills and switch the target to the one you want.
Do you know how to do this using the MZ plugin? I don't see any mention of JS Targets in the documentation for the plugin, though it would solve the issue. Any assistance would be much appreciated--thank you!
Hmmm, it's on their web page at least?

<JS Targets>
code
code
targets = [code];
</JS Targets>

- Used for: Skill, Item Notetags
- The 'targets' variable is an array that is returned to be used as a
container for all the valid action targets.
- This is NOT used for filtering out who the player can or cannot select.
- This determines a final result.
- The 'targets' variable will include the original set of targets determined
by the skill/item's original scale.
- Replace 'code' with JavaScript code to determine valid targets.
Hmmm, it's on their web page at least?

<JS Targets>
code
code
targets = [code];
</JS Targets>

- Used for: Skill, Item Notetags
- The 'targets' variable is an array that is returned to be used as a
container for all the valid action targets.
- This is NOT used for filtering out who the player can or cannot select.
- This determines a final result.
- The 'targets' variable will include the original set of targets determined
by the skill/item's original scale.
- Replace 'code' with JavaScript code to determine valid targets.
Wow, this is exactly what I'm looking for. I still have no idea where on their website you found that, but I very much appreciate you sharing!!
Cool, but yeah, like I wrote, it's a VS Battle Core notetag (not from the grid plugin EDIT: meant to say not from the AI plugin):

Original thread: https://forums.rpgmakerweb.com/threads/battle-ai-target-conditions-visustella.178401/