I think you're a bit confused about how some things work.
First off, you don't need to use an onTimeout like that. Try using replaceAni("sword", "punch") in say onCreated of that weapon.
Second,
HTML Code:
triggerAction(player.x+1.5+vecx(playerdir)*2,player.y+2+vecy(playerdir)*2, "punch", "player.account", "player.guild");
Isn't going to work like you think -- having quotes around player.account and player.guild will send those as the strings, not the values of them. And if you are hoping to trigger onActionProjectile with a punch event it isn't going to work.