execute if entity @s[tag=!fire_effect] run scoreboard players add @s n_effects 1

execute if entity @s[tag=!fire_effect] run scoreboard players operation @s fire_effect = duration n_effects
execute if entity @s[tag=fire_effect] if score @s fire_effect < duration n_effects run scoreboard players operation @s fire_effect = duration n_effects

execute unless score @s fire_effect_2 matches ..0 unless score @s fire_effect_2 matches 0.. run scoreboard players set @s fire_effect_2 1

tag @s add fire_effect
