Modified successrefitem script command

Added a new optional parameter to specify upgrade quantity, so its consistent with downrefitem which provides a optional parameter to specify downgrade quantity.
As proposed by kyeme in
http://hercules.ws/board/topic/2403-successrefitem/

Signed-off-by: shennetsind <ind@henn.et>
Fixed 3 'Declaration shadows a variable in the global scope'

warnings.

Signed-off-by: shennetsind <ind@henn.et>