There is no bracket missing in the snippet I posted.
And there should not be any semicolon after the while(my.skill1) at all.
That will give you an error too, after you found that missing bracket.

Update to the remove_torp1 function:
Code:

function remove_torp1()
{
if(event_type == event_entity || event_type == event_impact)
{
my.skill1 = 0;
}
}


However that should not make any difference, as the event function is only triggered when an event happens.