Repurposing the MP or TP Meter

Ahoy, everyone.

It's been years since I messed with RPG Makers at all and I'm trying to get back into it. I had an idea for, essentially, a Sanity Meter. Something that would fit within a world with Eldritch abominations. I think the best way to incorporate that is to have a Sanity Meter, something you have to maintain not unlike health. My idea is to repurpose Magic or TP so that as you fight the various monsters, depending on your level v. their level, your Sanity lowers (similar effect to Poison, I suppose). I can see some things I can do within the game maker as it is to accomplish this, but the main hold up I have right now is that I can't figure out, if possible, how to cause an immediate status effect should MP or TP reach zero.

Any thoughts?
Yanfly's Auto Passive States can have whatever condition you want for their activation, such as MP or TP being equal to 0.

You could also use a passive state that's always on and use Yanfly's Buffs & States Core notetags to check every time they're hit in combat to see if their MP/TP was brought to 0 and execute whatever code you want at that time.
Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/repurposing-the-mp-or-tp-meter.158623/