Make player immune to any damage for a certain period of time

when a switch is turned on, I want to make player immune to any damage for a certain period of time, say 30 seconds or a random variable.
Is there a way to do this? Thanks in advance for any answer
Use state with SP-Parameter traits of Physical Damage and Magical Damage set to 0%.
thank you
how about for outside of battles
I have some events that have "event touch or player touch" triggers that will change player hp,
is there a way to do this too? when a switch is on, then immune for 30 seconds or so
You could use conditional branch, and only apply the change HP command if the switch is OFF.
You could use conditional branch, and only apply the change HP command if the switch is OFF.
ok thank you!

Original thread: https://forums.rpgmakerweb.com/threads/make-player-immune-to-any-damage-for-a-certain-period-of-time.103532/