Making a plugin for damage formula calls

I'm mostly experienced with VX Ace, and I've started working with MZ. Something that I liked being able to do in VXA that I'm struggling with in MZ is creating damage formula calls in the script editor. In VX Ace I could write something like this:

Capture.JPG

and by typing in a.test(a,b) into the damage formula box on a skill, the battle system would use the defined formula. With this method I could create really intricate and interwoven damage formulas. I'm liking MZ a lot so far, and I would really like recreate this trick.
The same could be applied in RMMV/RMMZ.
Make a new JS file. Write something like
Code:
function test(a,b){
  return a.atk + b.def
}
Load it as a plugin.
You should have no problem using it just by typing test(a,b)
Oh wow, that did it. I figured I was over-complicating it, but I didn't realize by that much. Thank you! Problem solved!

Original thread: https://forums.rpgmakerweb.com/threads/making-a-plugin-for-damage-formula-calls.158937/