Control Variables via Plugin

So, I have got a small crafting system going but I am quite a noob at Javascript.

My main problem is increasing a control variable inside the plugin, in this instance:

I cook (craft) salmon and turn it into cooked salmon, that's good and all but for each salmon cooked I want a control variable to increase by one (So the player can get experience points). I'm sure it's possible, but could someone with the knowledge and willingness to help, teach me how?

I just need a piece of code to  go after the crafting of an object that would increase a variable already created in the maker.

I'd be forever thankful.
$gameVariables.value(1);            // Get value of variable 1


$gamevariables.setValue(1, 10);     // Set variable 1 to 10.
Yeah, it seems I don't know enough Javascript at all yet. I should get back to learning, sorry @Lavra, I'm sure, if I were proficient enough I'd make it work but I'm not haha.

Original thread: https://forums.rpgmakerweb.com/threads/control-variables-via-plugin.51374/