scoreboard players set min times_appeared 0

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

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

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

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

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

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

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

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