Activate effect under specific hp threshold?

I am trying to add an effect to an item which would activate a large stat increase once a player's hp falls below a certain threshold, such as 15%. I made a pendant item which adds the skill, defense in a pinch, and in that skill a state that doubles defense is activated . Confused on how to make this happen, sorry if it sounds a little confusing i'm quite new to this rpg making business. I have VX Ace btw.
you will need a script to make such an effect - with skills you could resort to a common event, but passive effects cannot be conditioned in default.


If you're new to RM, then it might be better for you to work on other parts until you're more comfortable with scripting - because scripting in RM is a full programming language.


If you need help in learning RM, follow the link in my signature.
You could do it with a common event in the troop tab. If (actor) has (accessory) equipped, checo if current health is less than x% of max health. If so, apply state.

Original thread: https://forums.rpgmakerweb.com/threads/activate-effect-under-specific-hp-threshold.21402/