Counter attack

I have looked everywhere for this and can't find it even though I thought this was something we'd definitely have somewhere. If this script does exist already, please direct me to it. But anyway, I'm looking for a script that will allow me to make a skill that works kind of like Counter in Pokemon, except this is the formula I want to use:


(the amount of physical damage done to user) x 1.(user's level)


However, by default in RPG Maker, not only is the Counter state "attack" always skill 001's effect, but the user does not take any damage. I want the damage delt to the enemy to depend on how much damage they took from the attack (which I'm not sure, could this part be done with custom formulas?) and I want the user to still take damage from said attack. I don't want this to be the actual Counter state in general, I just want this Counter skill to work like this. Furthermore the user will stop countering upon taking physical damage. 


VX Ace please. (Saying this because I see a lot of people get linked to MV plugins in this thread.) 


Also if this can be done without a script (with damage formulas perhaps?) I'd prefer that because I'm using a lot of scripts already. Thanks in advance.
Have you tried Tsukihime's battle reactions?
Sorry, this is a very late response... I haven't tried this yet, but it seems like it would work. However, what kind of attack formula would I need to make it so it deals double the damage the user has taken in that turn?
Sorry, this is a very late response... I haven't tried this yet, but it seems like it would work. However, what kind of attack formula would I need to make it so it deals double the damage the user has taken in that turn?



Store in a variable the health at the start of the turn and write something like "2*(v[n]-a.hp)".
At last I finally tried the battle reactions script. (I was busy doing other things in the game so I just got to it...) It wasn't working at all, (I tried to put it in the skill note tag) so I downloaded the demo provided to see what I was doing wrong. And it seems you have to put the note tag in the actor's notes, that's not gonna work.


I want the counter to work like Counter from Pokemon. Where you use the Counter skill, and when the opponent hits you that same turn, and if it's a physical attack (except I don't want all physical attacks counterable, so I want to specify which skill IDs trigger the counter), the one who used Counter will react and deal double the damage they got hit with. I don't want attacks to always counter on that actor, only when the Counter attack is used. Unless of course that script does allow you to do that and I'm just doing it wrong. And that the demo doesn't show how to do it with skill note tags.


Countering (not the RPG Maker way) is a fairly common thing in RPGs so if there's no script for this I'll be really surprised.
I use this script in my game and it works with states.


This is how I use it.


dvdvvdvdv.png

Original thread: https://forums.rpgmakerweb.com/threads/counter-attack.68421/