MZ Create a condition based on actor's HP/MP - Is it possible in MZ?

Hello, I ran into this problem while scripting in MZ.

I want to create a conditional that uses an actor's HP or MP as the determining factor. But it seems that the only way to do this is to convert those stats into variables and then run the conditional on those variables. What could I be missing? Or is there just no way to do that?

Thank you for any help.
You could use a script call in the Conditional Branch
you can do that (storing in variable) OR if you know some scripting just use conditional branch -> script:
Code:
$gameActors.actor(x).hp <= y
change x to your actor id
change <= to any comparison like == or >= depending on your situation
Spoiler
<= will return true if first value is lower or equal to second value
== will return true if first value is equal to second value
>= will return true if first value is higher or equal to second value
< will return true if first value is only lower to second value
> will return true if first value is only higher to second value
change y to to any number you want to compare with hp...

for mp just change .hp to .mp

above is current hp or current mp...

if you want to use actor MAXHP or MAXMP instead... just use
.mhp => max hp
.mmp => max mp

hope this help.
you can do that (storing in variable) OR if you know some scripting just use conditional branch -> script:
Code:
$gameActors.actor(x).hp <= y
change x to your actor id
change <= to any comparison like == or >= depending on your situation
Spoiler
<= will return true if first value is lower or equal to second value
== will return true if first value is equal to second value
>= will return true if first value is higher or equal to second value
< will return true if first value is only lower to second value
> will return true if first value is only higher to second value
change y to to any number you want to compare with hp...

for mp just change .hp to .mp

above is current hp or current mp...

if you want to use actor MAXHP or MAXMP instead... just use
.mhp => max hp
.mmp => max mp

hope this help.

Thank you so much this help me.

Original thread: https://forums.rpgmakerweb.com/threads/create-a-condition-based-on-actors-hp-mp-is-it-possible-in-mz.132537/