Script Call to Check if Player is not in combat

Wanted to test out a health regeneration passive state when the player is outside combat.
But can't figure out the right script call. Nor the best way to format it.

Trying:

<Custom Passive Condition>

if (user.hp / user.mhp <= 0.30 || !$gameParty.inBattle()) {

condition = true;

} else {

condition = false;

}

</Custom Passive Condition>

but it doesn't trigger properly. I'm assuming perhaps !$gameParty.inBattle() isn't the opposite as I thought.
===
A retest of a separated state conditions seems to work outside of combat, then removes it when in combat, but doesn't reapply it once outside combat.

Spoiler: Conditions
<Passive Condition: HP Below 30%>

<Custom Passive Condition>

condition = !$gameParty.inBattle();

</Custom Passive Condition>
can you show a screenshot of your plugin manager, your state, and how the state has been attached to the actor?

if (user.hp / user.mhp <= 0.30 || !$gameParty.inBattle()) {
that should be valid for what youre trying to do. if you remove all plugins except the bare minimum for the passive plugin to work, does the custom condition still not work?
Easiest test - assign an icon to the passive state. If you see the state icon on the actor, the condition is working.

As Robro said, your condition is correct - at least the one on the bottom is. The one in the body of your post is weird, because it will make the state work in combat if they're at or under 30% health which is not what you said you want.

How about a screenshot of the actual, entire state?

Original thread: https://forums.rpgmakerweb.com/threads/script-call-to-check-if-player-is-not-in-combat.173610/