How to make a freeze state like in Pokemon?

Okay so along with the petrify and stone states in my other post, I also need help with another state I'm making: the freeze state. Basically what the freeze state does is that it causes an actor to not be able to move until either a certain amount of turns pass or they are hit with a fire elemental attack, sort of how it works in Pokemon. I found yanfly's tutorial, but it was for the freeze status in Final Fantasy IX (which is much deadlier) and not the one in Pokemon. Can someone please tell me how I can make a freeze status? I can do everything except for make it so that a fire attack ends the state. Please help. Thank you.

-KrimsonKatt
For this one, you're going to want a Custom React Effect. This note tag triggers when the subject (the frozen battler) is hit by an action. From inside this tag, we can get information about the kind of attack that just hit the battler, and conditionally remove the frozen state from them.

JavaScript:
<Custom React Effect>
    if (this.item().damage.elementId == X && this.isHpEffect() && value > 0){
        target.removeState(stateId)
    }
</Custom React Effect>
Change the X to your fire element stateId can probably be left the way it is, but you can also change it to the Id of your frozen state.

The React Effect happens when the battler is struck by anything, so we use an if condition to make sure that the action that triggered it meets the following requirements:
  1. It is X elemental
  2. It is a damaging effect (HpEffect)
  3. It dealt more than 0 damage.
When all three of these conditions are met, it removes the Frozen state from the subject.
@ramza Thanks for the tips! This really helps!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-freeze-state-like-in-pokemon.120821/