Left HP as damage then dead

Hello.

I try to find a formula that make an enemy able use all left HP to damage 1 target and

then the enemy must die.

I tried many ways. I can reduce the enemy's HP to 0 then the Dead popup pops, but the

enemy not collapse.

Plus, tried to add a K.O. status, but seems to target only heros.

Going to work...

Thanks in advance
I'm not entirely clear about what you want, so I shall spell out what I have understood.

The ally uses all their own hp - if this is correct, then the ally will die.

The enemy must die.

If that is correct, try this in the damage formula box

c=b.hp-=b.mhp;a.hp-=a.mhp;c
Im not sure but i think he wants to make a self destruct skill for enemies.

If thats what you want, try this formula:

a.mat * 1200 - b.mdf * 600; a.add_state(1)
Ah, yes, it's the enemy.  My bad.  Though if that formula is put in the enemy's skill's damage formula box, it will kill the enemy.  The formula kills the user, whoever it may be.  

Trouble is, we don't know how effective he wants the attack to be.  Does he want the attack to kill the target, or to deal an amount of damage that is equal to the enemy's HP?  Or some third possibility?
Ah, yes, it's the enemy.  My bad.  Though if that formula is put in the enemy's skill's damage formula box, it will kill the enemy.  The formula kills the user, whoever it may be.  

Trouble is, we don't know how effective he wants the attack to be.  Does he want the attack to kill the target, or to deal an amount of damage that is equal to the enemy's HP?  Or some third possibility?
From what I've read, the enemy self-destruct itself by using all of it's HP to the target (in this case, any ally of the party), but it does not have to defeat the target, just get down it's HP like any attack would do.
Hello guys! Thanks a lot to help me.

Sorry if my english is so horrible, I did not know it was so bad.

"Rpglover88" found out what I want. I try to clear it for better explain.

I was in a rush when I wrote it.

I have an enemy WASP which at  <=75% HP (ie: 750/1000HP) readies "Final Sting"

This skill deals current HP (here is 750HP) to a single target.

And after that, the WASP must die/collapse.

EDIT: If possible no EXP/GOLD earned that way.
If you don't want there to be any EXP or Gold, then leave those boxes at zero in the database.

For the formula, try this

c=b.hp-=a.hp;a.hp-=a.mhp;c

Those semi-colons are important.
Your formula overkill the target.

I worked in a different way than a formula and it gives the effect I want.

The WASP has 2 almost same skill.

The 1st Skill (Skill: 1) deals to the target the current left HP, then it calls a commun event which

force the WASP to do the (Skill: 2) to deal itself the current HP and properly die/collapse.

The only setting I cant find, is:

(1) If heroes can kill the WASP before it uses the skill, the team earn the EXP/GOLD.

(2) If the WASP sacrifice, no EXP/GOLD.

EDIT: I found out for the EXP/GOLD

In the (Skill: 2) I added effect flee/escape, and it works

Formula.jpg
Not sure whether it works as you intended..

c=a.hp; a.add_state(1);c
@Murd

It works...

The problème is:

- If I edit a battle with 3 WASPS, the WASP which use the skill (of course will get the "Death" status)

but will never collapse and can confuse the player even if the "Death" WASP became untargetable.

- Plus, the hero team still get EXP/GOLD, and a "Self destruct" is not a win.

EDIT: I dont know all the typo formula, (the "c=" is not in the help popup text)

If there is a way to affect EXP/GOLD ... totaly an exemple:      

c=a.hp; a.add_state(1); exp-=100;c

or:

c=a.hp; a.add_state(1); gold-=100;c

It could simplify everything...
@Murd

It works...

The problème is:

- If I edit a battle with 3 WASPS, the WASP which use the skill (of course will get the "Death" status)

but will never collapse and can confuse the player even if the "Death" WASP became untargetable.

- Plus, the hero team still get EXP/GOLD, and a "Self destruct" is not a win.

EDIT: I dont know all the typo formula, (the "c=" is not in the help popup text)

If there is a way to affect EXP/GOLD ... totaly an exemple:

c=a.hp; a.add_state(1); exp-=100;c

or:

c=a.hp; a.add_state(1); gold-=100;c

It could simplify everything...
In a self-destruction skill, select HP damage and type a.hp in the formula box. And add common event to force the WISP to use skill flee.
With the flee, the enemy reappears a few frames after the victory aftermath, when it's closing.

I found many ways to finaly get something very close of what I want, So I'will think about them.

Thanks all for your help.

Original thread: https://forums.rpgmakerweb.com/threads/left-hp-as-damage-then-dead.38371/