Formula Functions

So I know a tiny bit about Javascript, but not much.  I have Yanfly's damage core plugin, and I can add in-game functions, but having trouble just making my own simple functions to work.

function Test(a, 😎 {
    return a-b;             

}

So this is just a simple example.  How do I get this to work?  I did value = Test(a.atk,b.def);

Am I missing something totally obvious?  This works fine when I write it out the formula in the notes area or formula box, but when I am trying to call my own function I get nothing.
The way you're doing, you are initializing a class, and to call that you would need to call  new Test(a, 😎

So instead, just do something like:

var test = function(a, { return a - b;}using test(a, 😎  will call the function
I got it to work.  Thanks for your help.  I was having a scope issue.

Original thread: https://forums.rpgmakerweb.com/threads/formula-functions.55019/