Surprise Attack Counter-Skill

So, this is in regards to the situations where a surprise attack occurs.
I wanted to give one of my party members a skill that deals more damage if your party is ambushed.
Similarily, I wanted to give a few enemies the power to counter preemptive strikes that your party can get as well by having a skill that increases in strength if you get the edge. I tried finding a proper script for it and fiddled with some things but I honestly am stumped. In my game I use a lot of Yanfly plugins, if that helps.

Any suggestions on the matter would be a big help, thanks!
You should be able to reference BattleManager._surprise and BattleManager._preemptive to determine if the battle was either of those.

They're both set to false at the end of the turn, so you'll have to use a Turn 0 troop event that checks them and sets a game switch accordingly (or something like that).

Then you can simply reference those switches in your damage formulae.
You should be able to reference BattleManager._surprise and BattleManager._preemptive to determine if the battle was either of those.

They're both set to false at the end of the turn, so you'll have to use a Turn 0 troop event that checks them and sets a game switch accordingly (or something like that).

Then you can simply reference those switches in your damage formulae.
Interesting, I'll test that out then, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/surprise-attack-counter-skill.152686/