gain item at level up

I want to modify the level up function to add an item to the party's stash (to be used as currency for skill choices at the shop). What is the correct method for doing so?

*edit* added this question to the general javascript questions thread instead. - this can be removed.
This plugin should be able to do that: http://forums.rpgmakerweb.com/index.php?/topic/48468-bobstahs-level-up-bonuses-v101/
That will work, thanks.
Actually I cant get the plugin to work, not sure about correct notation etc. Any experience in using it ?

Original thread: https://forums.rpgmakerweb.com/threads/gain-item-at-level-up.48897/