Help Creating A Passive Effect That When Applied, Doubles Damage Taken When TP is 0 Then Regenerates TP?

Hi, I'm trying to make a state that applies to the target when their TP reaches 0, since in my game it acts like health shield kinda. What I want the state to do is, when their TP reaches 0, it prevents them acting for 2 turns and doubles all they damage take for those 2 turns, then fully regenerates after those 2 turns have passed? I'm not sure how complex it is but any help? I'm also using Yanflys Auto Passives related plugins if that helps.

Original thread: https://forums.rpgmakerweb.com/threads/help-creating-a-passive-effect-that-when-applied-doubles-damage-taken-when-tp-is-0-then-regenerates-tp.159583/