How do i make a "Death Countdown" Status in battle?

i want to know how you make a countdown status which works like Perish Song in
Pokemon. when you are inflicted, nothing happens, but after 3 turns the targeted
character dies. do you guys have any idea how to make it? because making it manually
via database>states, i dont know how to to program the state to give the target, "death"
after 3 turns.
The simplest option would be to make it something that is checked every turn via troops.
Have your skill apply the counter status ("Doomed" maybe) with whatever probability you want, then run a Common Event off of the skill to check. If any target has the status Doomed, also apply "Perish". Then let the Doomed status run out over 3 turns and check via troop eventing if anyone has the status Perish and NOT the status Doomed. If so, apply Death to them.
Make sure both statuses auto-remove after battle ends.

For the sake of checking this every turn without needing to put it manually into every single troop, you can use https://yanflychannel.wordpress.com/rmvxa/utility-scripts/base-troop-events/
another option

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-a-death-countdown-status-in-battle.147135/