scoreboard players set min times_appeared 0

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

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

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

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

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

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

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

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

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

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