I want to have a character whose passive state causes any healing skills they use to scale off of Atk instead of Mat. I've figured out enough to check which skill the character has selected, check if the damage type is HP Recovery, and I've even been able to store the damage formula in a variable, then use replace() to change "a.mat" to "a.atk" in the string if it exists, but I don't know how to feed that formula back in to be used for damage calculation. I obviously can't just replace the formula in the skill itself, as that would cause it to scale off of Atk for other characters as well.
Is this even something that can be done with the Buffs and States Core, or would I need to use something like Damage Core? I've never looked into the latter so I don't know if it can even be used with states or how to do so.
Edit: For more context, this is what the state tag currently looks like:
Is this even something that can be done with the Buffs and States Core, or would I need to use something like Damage Core? I've never looked into the latter so I don't know if it can even be used with states or how to do so.
Edit: For more context, this is what the state tag currently looks like:
JavaScript:
<Custom Confirm Effect>
// Get the current skill
var skill = this.item();
// Checks if the skill type is "HP Recover"
if (skill && skill.damage.type === 3) {
// Store the contents of "formula" as a variable
var formula = skill.damage.formula;
// Checks if the formula uses M.Attack
let usesMat = formula.includes("a.mat");
if (usesMat == true) {
// Creates a new formula string with "a.mat" replaced by "a.atk"
let newFormula = formula.replace("a.mat", "a.atk");
}
}
</Custom Confirm Effect>