State given when a user is below a certain amount of health

I am using Yanfly's AutoPassiveStates plugin. I am trying to make it so when a user is below a certain amount of health, an actor receives a state. The problem is, the way I have it now below, the actor always has the state active. How do I make it so the actor only receives the state when the user is below a certain amount of health?

<Custom Passive Condition>

if (user.hp / user.mhp <= 0.26) {

$gameActors.actor(1).addState(23);

condition = true;

} else {


condition = false;

}

</Custom Passive Condition>
Do you mean you want the state to be removed if their HP recovers? In that case, try adding the line
$gameActors.actor(1).removeState(23);
into the else branch.
Do you mean you want the state to be removed if their HP recovers? In that case, try adding the line
$gameActors.actor(1).removeState(23);
into the else branch.

That is good, but I'm having another issue. With the way it is now, the state only applies to the actor if ALL enemies (users) are below a certain amount of HP. How do I make it so it only takes any one enemy to be below a certain HP for the state to be given?

Edit: never mind. I resolved the issue.

Original thread: https://forums.rpgmakerweb.com/threads/state-given-when-a-user-is-below-a-certain-amount-of-health.82918/