Troubles with setting condition switches for enemy skills

All needed info is in video. Basically enemy uses skill he has no access too. No, I don't have any plugins altering AI. It's just thing that happens.

Edit: Okay, I guess they stopped doing that... Skill is still broken anyway, so I guess I change name of topic and continue about that.
Troops has that line. Basically it's SUPPOSED to check if enemy is 40-0% HP, and if so, turn on skill switch, which then triggers them using said skill. Currently it does nothing, and enemy just does skill. And no, no other thing turns on that trigger.
1702035015426.png

Edit 2: I changed it to <40, and this works appeareantly??? Okay, so it... kinda does? Enemy does that, when on 60-70 HP, which makes no sense, since 40% of 150 is 60.
First, please don't use videos where a screenshot would be enough. several of the people helping here have problems with videos for various reasons.

Second, please do NOT crop those screenshots, because the event properties are as important as its commands - and even more important if it doesn't trigger correctly.

third, your script line is not a condition, and the conditional branch absolutely requires a condition to work correctly - not a simple function call.

fourth, why are you doing something that complex if the troop event conditions and the troop action patterns both have options for HP value conditions?
Edit 2: I changed it to <40, and this works appeareantly?
well, yes. hpRate() doesnt take parameters. you dont put anything in the parentheses when using it, nor will it do anything. before you changed it, you basically just said "if they have an hp rate, flip the switch" instead of "if their hp rate is less than 40%, flip the switch". Even if it did take the 40 as a value and it worked the way you initially thought it did, it would have only triggered if the hp rate was 40% specifically. if they never hit exactly 60 hp it wouldnt have taken effect

you havent shown exactly what you current line is, but itll have to change if its "$gameTroop.members()[1].hpRate() < 40". the number hprate returns is a decimal representation of the hp to max hp ratio. 40% would be .4. if it is what said earlier, the switch is flipped as long as that enemy has less than 4000% of their max hp
It says 30%. He has 150 HP and uses it on 70 HP. How? Maybe "30-0%" is how much damage you need to deal, for enemy to trigger it?
EDIT: Forget about, like, everything. I have no idea how and when, but something caused them to use this thing via code I have no idea where to find. After moving enemies, troops, and skill I had problem with, it seems to solved itself. I then trying to find the clue by dumping every js file into notepad+++ and searching for skill ID, but nothing.
1702039928663.png

1702039901058.png
Maybe "30-0%" is how much damage you need to deal, for enemy to trigger it?
No, you need to pay attention to details.
"30% - 0%" means GREATER THAN 30% and smaller than 0%

The correct condition would display as "0% - 30%"

And I strongly suspect that the rest of the "errors" you experience are caused by similar mistakes in other places, for example I strongly suspect that you have absolutely no idea how the rating in the action pattern works, or you wouldn't have used rating 1 at all...
No, you need to pay attention to details.
"30% - 0%" means GREATER THAN 30% and smaller than 0%

The correct condition would display as "0% - 30%"

And I strongly suspect that the rest of the "errors" you experience are caused by similar mistakes in other places, for example I strongly suspect that you have absolutely no idea how the rating in the action pattern works, or you wouldn't have used rating 1 at all...
Rating 1 is intentional, so they would prioritize other moves when I need them to.

Original thread: https://forums.rpgmakerweb.com/threads/troubles-with-setting-condition-switches-for-enemy-skills.163676/