(Solved) Life leech skill

So, I was wondering if perhaps there is a way to make a skill that drains life of an enemy and heal the same amount of damage at the same time ([edit]for a few turns, like a state). I know that RMMV have a plugin for that, but I can't seem to find one for MZ. Is it possible to creat such a skill
only using the engine itself?

Thanks in advance!

[Edit]

I'm just summarizing what @ZRo_Shadoh explained:

1 - First, I created a Leech Life (drain) state to be added to the target

Spoiler
1613690843763.png

2 - Then, I created a Leech Life (regen) state to be added to the caster (actor)

Spoiler
1613690890133.png

3 - Then, I created a variable called "Leech life" and a common event, and then, set the "Leech life" variable with the "Last Actor ID to Act"

Spoiler
1613690964399.png

4 - Lastly, I added the "regen" State to the variable

Spoiler
1613691074219.png

And again, as @ZRo_Shadoh said, the amount of "damage" and the amount of "regen" aren't the same, but hey, it works for me =).
Is there any reason why you can't use the "HP Drain" damage type?
Is there any reason why you can't use the "HP Drain" damage type?
Because the HP Drain only works on a single attack (as far as I know). My idea is like a state that lasts for a few turns. Sorry if I wasn't clear.
For the enemy, create a Poison state that takes away health for x number of turns. Create another state for the actor's HP Regen, and give it the same number of turns as the enemy's state.

Give the HP Drain skill the enemy's state. For the actor to have their state applied, give the skill a common event.

In the skill's common event:
  1. Set a variable to get the last actor's ID who acted (which would be the actor who used the HP Drain skill).
  2. Add the actor's HP Regen state to the variable containing the character's ID. This will give the actor the state.
Depending on the enemy and the actor's HP, the damage dealt to the enemy might be much greater than the actor's HP gain, or vice versa. This depends on how much HP both have.
For the enemy, create a Poison state that takes away health for x number of turns. Create another state for the actor's HP Regen, and give it the same number of turns as the enemy's state.

Give the HP Drain skill the enemy's state. For the actor to have their state applied, give the skill a common event.

In the skill's common event:
  1. Set a variable to get the last actor's ID who acted (which would be the actor who used the HP Drain skill).
  2. Add the actor's HP Regen state to the variable containing the character's ID. This will give the actor the state.
Depending on the enemy and the actor's HP, the damage dealt to the enemy might be much greater than the actor's HP gain, or vice versa. This depends on how much HP both have.

Thanks for the answer, fellow Maker. I'm having a little trouble in the part 2 of the skill common event... how to I add a state to a variable?
If you go to the Actor section on tab 1, you can select the Change State command.

After selecting Change State, click Variable, and choose the variable for the Actor's ID. Then click the dropdown button under State and choose the HP Regen state you created.

Spoiler
Screenshot 2021-02-18 143838.png
If you go to the Actor section on tab 1, you can select the Change State command.

After selecting Change State, click Variable, and choose the variable for the Actor's ID. Then click the dropdown button under State and choose the HP Regen state you created.

That worked!!!!!

Thank you so much!

I couldn't make it work for monsters, though. I changed the variable to this:
1613690246992.png


But the "regen" state wasn't added.

Did I miss something or it is not possible?

Once again, thank you!
Someone can correct me if I'm wrong, but AFAIK, you can't give a specific enemy in a troop with multiple enemies a state without using a script. You would have to get the troop enemy's ID.

You can select Change Enemy State on tab 3 under Battle, but you can only choose between the entire troop, or a fixed enemy in the troop.

I suppose one way it could work without scripts is if you only have one enemy in the troop. In that case, the above would work for giving the enemy a state, by selecting enemy #1. You also wouldn't need to set a variable either.

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/solved-life-leech-skill.133412/