You'll have to create a shitload of items, all the same but for the number of charges in them, and you'll have to change items in decreasing order of charges. In short, a charges system. Also, each time you have to refer to that item you'll need a function of "item1 or item2", with all the different items.
There's bound to be one in the Hive... Look in the spells section.
Sounds like tough work? Well, it is.