execute as @e[tag=d_2] run scoreboard players add @s time 1
execute as @e[tag=npc_m2] at @s if score @s time = @e[tag=d_2,limit=1] time at @s run tp @e[tag=npc_d_1] ~ ~ ~ ~ ~
execute if score @e[tag=d_2,limit=1] time >= #end_m2 time run tag @e[tag=pre_lvl4] add lvl4
execute if score @e[tag=d_2,limit=1] time >= #end_m2 time run tag @e[tag=pre_lvl4] remove pre_lvl4
execute if score @e[tag=d_2,limit=1] time >= #end_m2 time run scoreboard players reset @e[tag=d_2] time