I want to make an ability that damages an enemy and heals the user.

Hello! In my game, I am trying to make an ability that will deal damage to an enemy and then heal a set amount of hp to my ability user, Ahiga. What I have currently is an ability that will damage the enemy and then restore hp to the enemy. How do I change the ability to do what I am trying to do? Would I need a plugin for this?

1740173301162.png
first, VXAce uses scripts and not plugins. and no, you don't need a script - although some scripts can help.

The simplest solution is to use this damage formula:
EDITED FORMULAE
a.hp+=(0.15*a.mhp).to_i; a.mat * 4 - b.mdf * 2.5

this will add 15% MaxHP to the skill user before doing damage.
However there is a minor problem with that formula: you cannot use the autobattle feature for any actor using that.

The problem is that the autobattle tests all skills to see which does most damage, and in that test it would heal even if a different skill is choosen.

If you want to use autobattle, then you need to use yanfly's script for lunatic formulae to heal outside the damage formula with a notetag
Your solution technically does the job, but it doesn't make the "HP gained" effect that other methods of restoring hp makes. It also turns my numerical value from being a whole number with no decimal point to being a number with a .0 at the end. It's technically the same number but it looks off compared to other party members. Is this a problem caused by a script?
1740190016666.png
yes, because I forgot to turn the number into an integer. and I'm too tired at the moment to remember how to do that.
I'll check it on the weekend after some sleep, come back here later to see the update.


EDIT:
I edited the formula above to remove the floating point numbers, but I haven't found a way to add a healing text, sorry.
Your solution technically does the job, but it doesn't make the "HP gained" effect that other methods of restoring hp makes. It also turns my numerical value from being a whole number with no decimal point to being a number with a .0 at the end. It's technically the same number but it looks off compared to other party members. Is this a problem caused by a script?
View attachment 332167
I think this would work better with yanfly follow up skill script.
The main skill would damage the enemy and the follow up would heal.

Original thread: https://forums.rpgmakerweb.com/threads/i-want-to-make-an-ability-that-damages-an-enemy-and-heals-the-user.175709/