scoreboard players set min times_appeared 0

execute if score #spring_water shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = spring_water times_appeared
execute if score #spring_water shop matches 1 if score spring_water times_appeared < min times_appeared run scoreboard players operation min times_appeared = spring_water times_appeared

execute if score #burning_rage shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = burning_rage times_appeared
execute if score #burning_rage shop matches 1 if score burning_rage times_appeared < min times_appeared run scoreboard players operation min times_appeared = burning_rage times_appeared

execute if score #venom_gass shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = venom_gass times_appeared
execute if score #venom_gass shop matches 1 if score venom_gass times_appeared < min times_appeared run scoreboard players operation min times_appeared = venom_gass times_appeared

execute if score #metal_skin shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = metal_skin times_appeared
execute if score #metal_skin shop matches 1 if score metal_skin times_appeared < min times_appeared run scoreboard players operation min times_appeared = metal_skin times_appeared

execute if score #bee_wand shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = bee_wand times_appeared
execute if score #bee_wand shop matches 1 if score bee_wand times_appeared < min times_appeared run scoreboard players operation min times_appeared = bee_wand times_appeared

execute if score #electric_charge shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = electric_charge times_appeared
execute if score #electric_charge shop matches 1 if score electric_charge times_appeared < min times_appeared run scoreboard players operation min times_appeared = electric_charge times_appeared
execute if score min times_appeared matches -1 run scoreboard players set min times_appeared 0