Need advice on setting up smithing/alchemy skills

I currently have 6 variable based skills (alchemy, smithing, gathering, mining, locking picking, and charisma) that when used in game proc a chance to increase in value (from 1-500). The two I am having to trouble with are smithing and alchemy which need to be able to increase in value when an item is made using Yanfly's item synthesis.

I am not sure how I can or would register when an item is made using item synthesis, however. Any insight into this would be greatly appreciated.
I'd be curious to see if you find a means of achieving this
From the YEP Item Synthesis docs:
Code:
 <Custom Synthesis Effect>
   var bottle = $dataItems[123];
   $gameParty.gainItem(bottle, 2);
  </Custom Synthesis Effect>

Now that isn't the CODE you want, but it's the relevant documentation.
What you want to do is put some JS in there to increase your variable.
something like:
Code:
<Custom Synthesis Effect>
var x = $gameVariables.value(yourvarid);
$gameVariables.setValue(youvarid, x+1);
 </Custom Synthesis Effect>
Something like that. I don't have YEP, but I have the MZ equivalent and that should do the trick.

Put that in the notetag for any item being created by smithing, it will increase the variable.
I don't know how you would handle a skill up on creating multiple items at a time, though.
The MZ VS version has a variable available which is the number crafted, which I'm not seeing in these docs...
Thanks for the tip man! I don't know any js myself but maybe I can find someone who can check it out for me. I imagine the script could trigger a common event just as easy as raising a variable, that would even better.
Hey Snarky
The code I put should do the job. So, let's assume, for example, that your variable for tracking
smithing is Variable 100.

The code would look just like this:
JavaScript:
<Custom Synthesis Effect>
var x = $gameVariables.value(100);
$gameVariables.setValue(100, x+1);
 </Custom Synthesis Effect>

Like I said, if you put that in the note tag for a craftable item, just after the ingredient requirements, each time a that item is created, the smithing variable should increase by one.
And looking at the YEP example, I think that would even run for each item created when creating multiple items at the same time. I could be wrong, and can't actually test, but that's how it seems.

Give it a try.
Ok, I will check it out today when I get home. Gotta head into town for a bit. I'll let you know how it goes.

Edit: Would it be possible to have the code trigger a common event rather than raise a variable? Just curious.

Hmm, where exactly do I put that code? In the item note tag or somewhere in the js file for YEP_ItemSynthesis?

Edit: Hey man, it worked! I had to try it to see before I left, lol. Thanks a lot! I can even use different variables for different items so it works for smithing and alchemy. =)

Original thread: https://forums.rpgmakerweb.com/threads/need-advice-on-setting-up-smithing-alchemy-skills.129839/