Various Formula and Eventing Questions

Hi, so I've been creating a game recently and my project is coming along nicely, however I'm trying to create a few skills that do certain things that I'm having serious trouble doing. I'll be listing all the skills I've been having extra trouble making and I hope I'll get some answers and assistance.

Let's start with a skill called Revenge, which is meant to deal 80% of the user's Attack stat (I'll use the acronym AD as in attack damage from here on out) but increases that damage by 2% for every 1% health the user has lost. I know that you can easily do this via hp points but percentage is what I'm having a hard time with. (Ex: User has 100 Atk and has lost 50% of his HP, dealing 100% more damage or the equivalent of 200 Atk)

Next is a skill called Healing Shield, which is meant to heal all party members 15% of the damage any party member with the shield applied takes. This one I can't figure out at all. (Ex: Party Member has Healing shield up and is hit for 100 Hp damage. Every member of the party is healed for 15 Hp)

Next up, Holy Strike. The skill is meant to heal the most hurt party member by 40% of the damage that it deals to an enemy. I thought I might accomplish this through variables but I cannot figure out how to set a variable based on how much damage an attack dealt. (Ex: Party Member A uses Holy Strike and deals 100 Hp damage, healing party member B for 40 Hp because party member B has the least HP in the party)

Another move, which I think may be the toughest, is Devotion, a move meant to make a party member take 35% less damage and the user of Devotion takes the damage instead. I haven't the slightest clue as to where to begin with this. (Ex: Party Member A applies Devotion to Party Member B, and an enemy attacks B. Enemy would deal 100 hp damage to B but instead deals 65 hp damage to A.)

Next may be simpler, the move Feral Assault, which deals 60% AD is meant to deal 150% more damage to enemies with a harmful effect on them. I'm not sure how to do this, perhaps to use the initial move to trigger a common event to check for states that I consider harmful and if the condition is met then use an attack of either 1.5 AD or 1.0 AD? (Ex: Target has a harmful effect such as Stun which means instead of taking 60 Hp damage twice he takes 90 Hp damage twice)

Ancestral Protection is the last move I'd like to have solved for now, which simply applies a harmful state to an enemy if the enemy attacks the Party Member being protected. I.E. if an enemy hits an actor with the state Ancestral Protection then said enemy now deals 40% less damage.

I really appreciate help and ideas with all of these. Thanks a heap!
I wrote three Code Snippets for you that cover the effects you want for Healing Shield, Devotion and Ancestral Protection.

I don't think the other skills you asked for are hard to do, but I haven't looked into Yanfly Lunatic Damage yet.

All three Code Snippets will need Yanfly Lunatic States in order to work.
I wrote three Code Snippets for you that cover the effects you want for Healing Shield, Devotion and Ancestral Protection.

I don't think the other skills you asked for are hard to do, but I haven't looked into Yanfly Lunatic Damage yet.

All three Code Snippets will need Yanfly Lunatic States in order to work.
Ancestral Protection and Healing Shield look really good and I'm putting them in now. Healing Shield currently works wonders. However, I'm not sure Devotion is doing what I need it to, or perhaps I'm not reading into it correctly. Your code says the caster takes 70% damage and the actor afflicted with the state takes 30% less damage. If I'm to understand, this means that both actors take damage, and the caster of Devotion takes most of it. I mean for the damage dealt to be 30% less, and for the caster to take 100% of the damage dealt after the 30% reduction.
I've moved this thread to Script Request. Please be sure to post your threads in the correct forum next time. Thank you.
@KholeG

Ohh ok that's my bad.

Here's the corrected version.
@Alistair

Thank you! This looks great and works perfectly. If you do end up finding out my other attack issues or know someone who can don't hesitate to tell me.

You're awesome!
I think Revenge can be done using the damage formula.  I don't have access to Ace right now, so cannot check, but it might be something like this, using the default attack as an example:

(a.atk * 0.8) * 4 - b.def * 2 + ((a.atk * 4 - b.def * 2) * (a.mhp - a.hp)/(a.mhp * 2))

If you want it to be 1% increase per 1% HP lost, then the last part would be:

[SIZE=10.5pt](a.mhp - a.hp)/(a.mhp)[/SIZE]

[SIZE=10.5pt]If you want it to be 1% increase for 2% HP lost, the the last part would be[/SIZE]

(a.mhp - a.hp)/(a.mhp/0.5))

I've included the last 2 examples, because I know they work (I've used them), I'm just slightly unsure about the (a.mhp * 2).  But try it and see.

EDIT

For Feral Assault, try this (I think Stun is state 8, but check that):

b.state?(8) ? (a.atk *1.5) * 4 - b.def * 2; a.atk * 4 - b.def * 2

What this is doing is checking if state 8 is present.  If it is, it does the enhanced attack,  if not, it does the bit after the semi-colon which is the normal damage formula for that skill.
I think Revenge can be done using the damage formula.  I don't have access to Ace right now, so cannot check, but it might be something like this, using the default attack as an example:

(a.atk * 0.8) * 4 - b.def * 2 + ((a.atk * 4 - b.def * 2) * (a.mhp - a.hp)/(a.mhp * 2))

If you want it to be 1% increase per 1% HP lost, then the last part would be:

[SIZE=10.5pt](a.mhp - a.hp)/(a.mhp)[/SIZE]

[SIZE=10.5pt]If you want it to be 1% increase for 2% HP lost, the the last part would be[/SIZE]

(a.mhp - a.hp)/(a.mhp/0.5))

I've included the last 2 examples, because I know they work (I've used them), I'm just slightly unsure about the (a.mhp * 2).  But try it and see.

EDIT

For Feral Assault, try this (I think Stun is state 8, but check that):

b.state?(8) ? (a.atk *1.5) * 4 - b.def * 2; a.atk * 4 - b.def * 2

What this is doing is checking if state 8 is present.  If it is, it does the enhanced attack,  if not, it does the bit after the semi-colon which is the normal damage formula for that skill.
Do you think you could give me these without any defense calculations please? I've attempted to remove them myself and messed up the formula somehow. Also as a note all these attacks are done calculated only on the percentage times the AD (Atk stat) without say the 4 times used in the normal attack

EDIT

Can I list multiple numbers in the Feral Assault formula using commas or something else?
Without defence they would be

(a.atk * 0.8) * 4 + ((a.atk * 4) * (a.mhp - a.hp)/(a.mhp * 2))

b.state?(8) ? (a.atk *1.5) * 4; a.atk * 4 - b.def * 2

I left the DEF in the part where it specifies what is to happen if the state is not present.

These will now give massive damage, probably enough to one shot most enemies.  Is that what you want?

I'm not 100% sure I know what you mean with your second query.  Multiple numbers where?  In the state being checked?  In the damage formula?

EDIT

Instead of a semi-colon between the two parts (i.e. 😉 it might need to be a colon ( : ).  As I said I don't have access to Ace right now to check.
Alternatively I wrote another three code snippets for you. You'll need to have Yanfly Lunatic Damage in order for them to work.

Revenge, Holy Strike, Feral Assault.
Unfortunately I'm being less than helpful. I don't want these to do absolutely massive damage, as that would ruin the point of it.

Basically my question about the state checking, where you put the ID of the state to be checked for, is it possible to have multiple values in there to determine the states?

Another thing about how my battle system works: Defense doesnt exist at all. I use only attack and HP and hard set agility and luck stats. For the revenge attack I'm not looking for a one shot, simply something to increase the damage as my battler takes damage, not one shot enemies unless my actor is very low on HP, and even then only a bit. The damage can be increased at a max of 198% if left with 1 Hp and if the base attack power is 100 for example it should deal 1980 hp damage, no calculations for defense.

The same goes for Feral Assault, I'm only looking for a small increase based solely on the original attack of the actor without anything else. Where you have:

b.state?(8) ? (a.atk *1.5) * 4; a.atk * 4 - b.def * 2

I'd basically like

b.state?(8) ? (a.atk *1.5); a.atk

However another thing to note about the attack is it deals A.Atk*0.6 twice, with the 1.5 times increase added to that. Basically making it A.atk*0.9

I think I'll try using the lunatic damage snippets alistair provided, but thank you very much for the help
Alternatively I wrote another three code snippets for you. You'll need to have Yanfly Lunatic Damage in order for them to work.

Revenge, Holy Strike, Feral Assault.
These are really good looking and Revenge and Holy Strike are all set up. For Feral Assault, what would be the best method for adding multiple states in? 

Alternatively I could use a master state that is added to enemies if any state that is considered harmful is afflicting it.
You can now simply enter more than one state.
The script works perfectly! Thanks! I do have another request if you are willing, that being a state which applies poison based on the caster who set the poison's attack.

Like say I use the attack Thorny Vine which deals a.atk*0.35 but should apply a poison effect which damages health equal to the posion caster's attack.

Actor A attacks enemy B and deals 35 hp damage, and the target takes 100 hp damage per turn for 3 turns.

EDIT

Basically the one script here should take care of at least 3 to 4 skills I've planned with this effect
I've got heaps of papers to mark so I'll be off for now. If no one gets ahead of me, I'll help you out later.
Thanks a whole bunch for all you've done so far
You're welcome.

Here you are: Poisonous Stats.
Thank you once again :3
I'm in need of a quick move script to cause a party member to launch a random attack (one that is set for that specific actor) against an enemy. For example Actor A uses the move Lightning Fast (the move in question) On actor B, and actor B launches the attack Holy Strike, which is set to be his attack for this move.

Is this possible?

EDIT

Also the poisonous state script; I need to be able to adjust the percentage of the caster's atk that is dealt on the enemy, as attacks Acid Rain and Sticky Goo are meant to deal posion damage of 35% and 90% of caster's atk respectively.
I'm in need of a quick move script to cause a party member to launch a random attack (one that is set for that specific actor) against an enemy. For example Actor A uses the move Lightning Fast (the move in question) On actor B, and actor B launches the attack Holy Strike, which is set to be his attack for this move.

Is this possible?
It most likely is possible but I'm not sure if I can help you with that.

I updated the Poisonous stat script. The link I've posted above should direct you to the updated version now.

You'd use

<x effect: poisonous y: z%>or if you want to use an eval

<x effect: poisonous y: z% a>Just use - for y and 1% for z.

Original thread: https://forums.rpgmakerweb.com/threads/various-formula-and-eventing-questions.42850/