How to make a skill with a unique condition for extra damage?

There is a skill I'm working on and I'm at an impasse since I don't know how to write this code.


Essentially, I want a skill to do double damage on the condition the target enemy was attacked previously on the same turn. If it wasn't, then the skill does it's default damage.


Is this possible?
you'll need to mark the enemy to be able to detect that attack.


The best way to do that is to apply a state that lasts one turn only (because state removal is on the end of the turn), then check in the damage formula if that state has been applied.


However, for that to work the state has to be added as an effect of every other skill that can attack the enemy...
That's actually pretty brilliant!


Granted, it's gonna be a pain doing it this way, but that's a brilliant way of doing it that I hadn't considered.


It might also may be my only option. Thank you so much.
If you literally mean "Attacked" rather than "hit with anything", then all you need to do is have the Attack command add a state to the target that lasts just til the end of the turn, and does nothing else.  If you mean "hit with anything", then like Andar, I can't think of any way to implement this without either placing or removing a mark with every skill, unless you're willing to jump into some mostly simple code.


Basically what you want to do with the code is create a new "hit this turn" property for each battler (make sure to add an Attribute Accessor to it), setting it to false at the start of every turn and setting it to true whenever the battler is (successfully) hit by a member of the opposing party; I think you'd do the latter by modifying one of the Game_Action methods but it's possible it's actually in Game_Battler.  Then, your skill formula would just reference this property, doubling the value if it's true.


You could certainly post this as an RGSS3 Request; it's a pretty simple script that I think someone will probably be willing to write for you.
Yeah I specifically mean an attack that does damage to the enemy, and not poison damage or other state/status effect damage.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-skill-with-a-unique-condition-for-extra-damage.68638/