Code:

var phaser_decreasing = 0;

function init_player_startup()
{
while (player == null) {wait (1);}
player.phaser = 74;
while (1)
{
if(phaser_decreasing == off)
{
player.phaser += 0.4 * time_step; // increase power slowly
player.phaser = min(74, player.phaser); // limit phaser power 74
}
wait (1);
}
}

function beam_weapons
{
while ((mouse_left == 1))
{
phaser_decreasing = on;
player.phaser -= 3*time_step;
snd_play (beam_wav, 50, 0);
wait(1);
}
phaser_decreasing = off;
}

on_mouse_left = beam_weapons;



By the way, don't use the TIME variable anymore. It's kinda not stylish these days. use time_step instead. Use it in the exact same way, just a different name. I replaced your TIME variables in the functions above with time_step already.