The simplest way to do it would be to package the throw command, check (and store into a variable) what item the player is throwing before calling parent, then call parent, and if that variable exists, add the item back into the inventory after the parent is called.