Make Boss punish player for using certain actions.

Hey, I'm seeing if it's possible to make a boss that punishes the player for using certain actions (attacking, using an item, using magic etc.), similar to the Hikawa boss fight from Shin Megami Tensei 3: Nocturne.

Example:
1. The boss prevents physical attacks.
2. Player uses physical attacks.
3. The boss retaliates by instakilling the player.
4. Next turn, the boss prevents magical attacks.

Is there any way of replicating this system within RPG Maker MV?
It's fine if I have to use plugins, if any exist for this specific thing.
Absolutely possible without plugins.
One way of possible implementation could be running a common event and states with your skills.
Boss is using "Magic immune", your skill runs a common event to check if target has "magic immune" state, and if it does, apply "instakill target" state to skill user. The instakill move would also have a common that checks every party member for this instakill state, and if true, uses force action to execute the skill.

Mind you this is just one of many ways this could be done and I'm certain there are better ways too.
I would do this using Yanfly's Counter Control. As SGHarlekin said, put a state onto the boss indicating what mode it's in. That state has notetags saying "when you receive X kind of damage, counter with this skill."

That saves you from having to make common events for every skill and have those running for the entire game when this potentially only matters for one single enemy.

Original thread: https://forums.rpgmakerweb.com/threads/make-boss-punish-player-for-using-certain-actions.151778/