scoreboard players set min times_appeared 0

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

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

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

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

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