dofile( "data/scripts/lib/utilities.lua" )

local entity_id = EntityGetParent(GetUpdatedEntityID()) -- need to get parent of game effect, instead of game effect itself

function Drown(damageModelComponent, variables) -- function to lose o2
  variables["air_in_lungs"] = tonumber(ComponentGetValue(damageModelComponent, "air_in_lungs")) - 0.20
end

edit_component( entity_id, "DamageModelComponent", Drown) -- get the DamageModelComponent of entity with id entity_id, then apply Drown to it
