Checking for a state in an evented battle

So consider the following image:

Screen Shot 2017-06-03 at 9.18.29 AM.png

We see here that if Enemy 1 has 100% or less hp that we then loop and in said loop check if this enemy has the state Charmed applied.

This wont work, because the loop is always running, so the battle and the game essentially break. If I remove the loop then this page is run once, and because at the time it's run he doesn't have charmed attached to him, the console will be show the message as shown above.

If at any point in the battle he has charmed applied, I never see the message box.

What is the proper way to say: If enemy has x health and state y applied, then do z and have it, through out the battle, check: "do you have this state? No, carry on. Else, lets do something."
Change span to moment instead. Just note that if pages 3 - 6 are ever active though, this condition will never run regardless (as it always runs the highest page number which is valid), so keep that in mind.
Thats fine the higher pages he has less then 25% health. Thanks.

@bgillisp Just an update: moment breaks the battle too, it should be turn. as it will wait till Jacks turn before checking if he has x state applied.
True, but you didn't say you wanted it to wait until Jack's turn. Moment works as soon as the condition is met, Turn works at start (or end) of turn, battle runs once.
@bgillisp Hey, just a heads up:
Just note that if pages 3 - 6 are ever active though, this condition will never run regardless (as it always runs the highest page number which is valid), so keep that in mind.
This is wrong.

The battle events will actually run in order from the lower numbered page to the higher numbered page.
There's a tooltip in engine that tells you that, if you let the cursor hover on conditions.
You can test it by having two battle events at turn 0 giving messages 1 and 2. You'll see 1 and 2 in order.

Battle events pages don't function the same as normal event pages.
Funny, as I got it to run the way I stated in testing. But since it is really rare to ever need to do two pages active at once in a troop event, it is probably a moot issue.
Just for reference I'm gonna paste the tooltip here:
Conditions to start the event. The contents will be run only when all the set conditions have been met. If there are multiple event pages meeting conditions, the contents will be run in order from lower to higher numbered page.

It's actually important to know, because if you think that, like for event pages, the higher numbered page will take precedence you can run into some problems.
If you have page 1 for enemy hp < 50% displaying message 1 and page 2 for enemy hp < 30% displaying message 2, both messages will be displayed in order 1 -> 2 if an attacks puts the enemy from 100 % to 20% hp, unlike the way it would be if you had used a variable in event page conditions, where only the second page would have been ran.

Anyway, this isn't helping the op so I'll stop here.
So if I set it to battle then it only runs ONCE through the whole battle regardless of how many times it "meets" those conditions? One of my pages states: If enemy 1's health is 25% or less, do this. If I wait till turn for enemy1, he might be dead. Where as with battle it catches it right then and there - I would ideally like this to happen, the catching, all the time. I assume this is where moment happens?
Well, I'm just saying, when I tested it, it did go highest to lowest, regardless of what the tool tip says (though I did only test it once, and I've never needed it to go in any specific order so been a moot point for me). Though I also use ACE, so maybe it's changed for MV?
I test using MV exclusively, so my guess is that it changed from ACE to MV, yeah.

To answer the latest op question: all events run whenever the events conditions are fullfilled. Battle events run only once, turn events run only once per turn maximum, and moment events run for as long as the condition is still true, so you have to set the condition to false or they'll loop forever once triggered.
Right, and like I said I only tested it 1x too, so I could even be mistaken about ACE. Something I'll keep in mind if I ever need to set up my pages that way.

As for the OP's question: More or less what was posted above me. The only thing is, if the enemy goes from say 33% to 0% in one hit, many times the event that runs when HP is <= 25% will not run (especially if it was the last monster in the battle). I think they improved the catching of it for MV for when those cases occur, but its still something to be cautious of. Test it once and be sure it still catches it to be safe if you do something like that (easiest way is to give yourself a weapon which does 9999 damage in one hit).

Original thread: https://forums.rpgmakerweb.com/threads/checking-for-a-state-in-an-evented-battle.79481/