What about an attack that gets stronger if any other party member is below 50% Hp or dead?
Or an attack that crits if a variable is a certain number?
The first part is easily manageable using the array function .some
Code:if (a.friendsUnit().members().some(function(member) {return member.hpRate() < 0.5})) 50; else 30;
Where the 0.5 represents the 50% health. The 50 is the increased damage value, and the 30 is the reduced damage value.
To address if any allies are dead you could use something like this (again, 50 is increased damage, 30 is reduced).
Code:if (a.friendsUnit().deadMembers().length > 0) 50; else 30;
Whether an attack is critical or not is decided Before the damage value is evaluated so would be difficult to control from the damage formula. You may want to look into a plugin to do this for you.
Okay, so you can use a variable to alter a damage formula, but can you use a formula to change a variable? Also, do a skill's effects occur before or after a formula is executed (so you can use the newly changed variable in say a common event)?
You can use this function to control the value of your variables
Code:$gameVariables.setValue(x, y); damageFormula
Where x = variable id
y = value to be assigned
damageFormula = your normal damage formula
Providing you don't have any plugins altering things your common events should execute after the damage formula is evaluated.