Skills Causing Skills to Deal Bonus Damage

Basically I need help doing what the title says, lol.

Skill X causes Skill Y to deal bonus damage the next time it's used.  How would that be done?
Have skill x put a state on the actor.

Than utilize the damage formula of skill y for the rest.

Something like:

c= a.atk * 4 - b.def * 2; if a.state?(x); c*=2; a.remove_state(x); end; c
I'm not too great with code and whatnot, but can you break that down for me and explain what it all means?  That'd really help me understand what I'm doing.
Ok.

Do you know where the damage formula in the skills tab in the database is?

Looking at the one for skill 1 (attack) is read: a.atk * 4 - b.def * 2 (Or something like that.  I'm not at home right now.)

The a.atk is refering to the attacker's attack stat while the b.def is the defender's defense stat.

Now, to do what you needed to do, I made a temporary local variable "c".  I did this here because I needed to consider changing the value after it was calculated.

So, now I have: c= a.atk * 4 - b.def * 2

Which basically is the same as the original statement except, the value is now stored in "c".

The next part is an "if" statement.

This asks the game whether or not the attacker "a" has state(x) applied to it.

If so, it goes on with the next few parts.

-It takes the previously calculated value for c and multiplies it by 2.

-then it removes the state it was looking for at the start.

(the "end" marks the end of the if statement.)

*Note that the semicolons are used to separate the lines of code.  in programming, you'd normally see lines separated by pressing enter, but since we can only use the one line of the damage formula, we have to use semicolons.

Finally, you put "c" at the end to restore the value stored in c to the formula.  If you didn't do this, the damage would be the last argument you entered, which was not a number, so it would be changed to 0.

There are many really good tutorials on utilizing the damage formula.  Try googling a bit and see if you find anything.

Also, you can PM me if you need more assistance with this here.
Alternatively, you can have the state that skill x applies increase damage taken by a particular element and mark skill y as that element. It will only work for percentages without scripts, so if you want skill y's damage to be increased by a particular amount, then Maliki's solution is better.

EDIT: Also, if you wanted the state to be consumed by using skill y, then Maliki's solution is better.
Yeah Maliki's solution was great! Worked perfectly for me
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/skills-causing-skills-to-deal-bonus-damage.18433/