Creating a function in RM MV.

Hello. I have a noob question that will probably make people laugh here. :oops:

I am using Tsukihime's Formula Effect plugin to write my damage formula for basic attack, which uses several loops and conditionals. Most of the other skills such as disarm or knockdown use the same formula with a few details added. All is well and working fine so far.

The problem is when I have to change or add something new to the formula, I have to do the same for every single skill, which is hard to keep track and I often forget one skill or another. Is it possible to write a function somewhere and have the skill use it instead?
#1: Open your game project folder > data folder > look for Skills.json file - Open it (with Notepad/ MSWord)
Now you may see a lots of text there, sthing like this:
{"id":3,"animationId":-1,"damage":{"critical":true,"elementId":-1,"formula":"a.atk * 4 - b.def * 2","type":1,"variance":20},"description":"","effects":[{"code":21,"dataId":0,"value1":1,"value2":0}],"hitType":1,"iconIndex":76,"message1":" attacks!","message2":"","mpCost":0,"name":"Dual Attack","note":"","occasion":1,"repeats":2,"requiredWtypeId1":0,"requiredWtypeId2":0,"scope":1,"speed":0,"stypeId":0,"successRate":100,"tpCost":0,"tpGain":5},

Now if all of your skills has some identical words then it will be easy to chance, for example if all your skill has formula like:
a.atk * 4 - b.def * 2 + extraformula
Just hit Ctrl+H and replace "extraformula" with whatever you want
So a tip is to always group all identical expression into one group, so it will be easier to change later
Thank you! 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-function-in-rm-mv.89295/