scoreboard players set min times_appeared 0

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

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

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

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

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

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

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

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

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