scoreboard objectives add p2_ammo dummy

scoreboard players add @s p2_ammo 1

execute @s[scores={p2_ammo=15},hasitem={item=hd:p-2,location=slot.weapon.mainhand}] ~~~ replaceitem entity @s slot.weapon.mainhand 0 hd:p-2_empty 1 0