
# -> Temp tag
tag @s add OverlyRealistic.Player.TempPlayer

# -> Increase healthcare XP for helper player
execute as @p[tag=!OverlyRealistic.Player.TempPlayer,distance=..2,predicate=overly_realistic:player/actions/player_is_shifting] run \
    function overly_realistic:players/wisdom/healthcare/add_to_skill_xp_c_help_downed_player

# -> Remove downed tag
tag @s remove OverlyRealistic.Player.IsDowned

# -> Remove downed player parent ent
execute as @e[type=block_display,tag=OverlyRealistic.DownedPlayerParentEnt] \
    if score @s OverlyRealistic.Player.DeathID = @p[tag=OverlyRealistic.Player.TempPlayer,sort=arbitrary] OverlyRealistic.Player.DeathID \
    at @s run \
        function overly_realistic:general/downing/downing_parent_ent_remove

# -> Remove attributes
attribute @s movement_speed modifier remove overly_realistic:downed_player_movement_speed
attribute @s jump_strength modifier remove overly_realistic:downed_player_jump_strength
attribute @s gravity base reset

# -> Remove tag
tag @s remove OverlyRealistic.Player.TempPlayer

# -> Damage player
execute unless score @s OverlyRealistic.Player.Health matches ..6 run \
    damage @s 6.0 generic
