Add a state after another state disappears

Would it be possible to automatically add a state to an actor/enemy right after another state disappears?

Example:
My actor has a skill called rage mode that gives a state that increases crit rate by 100% for 3 turns. I want, after these 3 turn pass, to automatically give them a state that "stuns" (making them unable to attack maybe for 2 turns) to balance the power of the first state.
not by default, but there are several scripts that add this mechanism.

I think tsukihime has one on himeworks.com
Shaz state commands

Original thread: https://forums.rpgmakerweb.com/threads/add-a-state-after-another-state-disappears.147012/