There seems to be very little documentation for what the actual code is to do Lunatic stuff and unless it's been used in a Tips and Trick before, I can't really figure out how to do it. For example here are two skills I can't quite get to work right:
One is a skill that does AoE damage to enemies and heals all party members based on the damage dealt. It almost works but I don't know the code for 'target all allies and heal them based on a variable' I found a spreadsheet with some code stuff and it functionally works, it just doesnt have the healing number popups like it's supposed to:
<Post-Damage Eval>
var heal = value / 2;
$gameParty.members().forEach(function(m){
m.gainHp(Math.round(heal));
});
</Post-Damage Eval>
I was planning on using this idea of a skill that damages enemies and also heals the party for a couple different skills too, just with different numbers.
My other idea was a Passive Skill that, on a critical hit, would reduce all cooldowns by 1 turn. That one also almost works but not quite because I can't find the right code to do the thing. I've tried:
This one does nothing
<Custom Establish Effect>
if (target.result().critical)
{
user.setCooldown(44, -1);
}
</Custom Establish Effect>
this one also does nothing
<Custom Establish Effect>
if (target.result().critical)
{
this.actionGlobalCooldown(-1);
}
</Custom Establish Effect>
and this one used an external skill to lower the cooldowns using the notetags, but that one would interrupt multihit skills to use the cooldown reducing skill and it also had the problem of infinitely looping using the skill forever after your turn was over for some reason. But because this one does actually do something on a crit, I know that it's not a problem getting the passive to actually activate.
<Custom Establish Effect>
if (target.result().critical)
{
BattleManager.queueForceAction(user, 68, user);
}
</Custom Establish Effect>
The only code relating to cooldown timers I can find is user.setCooldown which sets it to a number, when I just want it to subtract from the already existing timer. Like a user.reduceCooldown or something but that also doesnt work, and I'm not experienced enough with js to be able to go through the script and actually tell what part of it is the code you would use in Lunatic stuff.