I want to check enemy hp percentage

Hi friends, here I want to check enemy current %hp, whenever enemy hp above 80% it will always use Tempest Whorl skill, but it didnot work, is it my script wrong?

$gameTroop.members()[0].hp_rate >= 0.80

1704454015434.png
hp_rate is Ruby syntax; you want to use hpRate() instead.
it finnaly work, thank you!
why use a troop event?
you can simply enter that in the enemy action pattern with condition HP between 80% and 100%

Original thread: https://forums.rpgmakerweb.com/threads/i-want-to-check-enemy-hp-percentage.164481/