PHP Code:
function onWeaponFired() {
if (this.out) {
this.doAttack();
} else {
this.drawGun();
}
}
Handle this.out in drawGun(); and your projectile function in doAttack(); and you're right as rain. I normally handle gani replacement within such scripts and ensuring that the weapon variables are properly set/carried across uses in functions like this at the same time. This may seem a bit sparse, but I'm sure you're capable of toggling a boolean value within a function without being told how to do it.
You really don't need to use a timeout for this.