Thanks, I've been looking at the code and trying to understand what you want to achieve.
Right now you have the functon "damage" that only seems to handle damage dealt by the player to enemies.
You got several hitbox objects that contain the damage value depending on the attack I suppose, and try to retrieve the correct damage value inside the function (for each playerhits : substract damage, etc).
You should abstract the damage function in order to make it more universal. That means no object picking inside the function other than UIDs. The reason is, how the function is built now, it won't work in the absence of playerhits (the loop would run 0 times).
Also, I think by Construct's picking laws, every shuriken would get destroyed. If you later decide to have more than 1 shuriken on screen at a time (power ups etc.) this would be a source for bugs.
The basic function setup is fine, however I would extend it to a certain degree.
Think of what can cause damage in your game (enemies, shurikens, sword strikes, etc). Create a family, put all relevant objects inside and name it "damagedealers" or something. Attach a variable damage to it and set it accordingly across all objects.
Think of what can receive damage in your game (player, enemies, destructible objects), put all relevant objects inside and name it "damagereceivers" or similar.
Then in your damage function, add number paramater "source" or something.
Now you are able to build more generalized damage events.
Handle the rest inside the function.
For example, create a basic collision damage trigger.
->On collision damagedealers with damagereceivers: Call function "damage" , passing damagedealers.uid as source and damagereceivers.uid as target, damagedealers.damage as damage
Now you got everything you need to work with inside the function.
For example, you can let the player lose health, let the enemy lose HP, destroy the shuriken, etc.
On function damage ->
"damagedealers": Pick instance with UID source:Do generalized stuff valid for the whole family. E.g. play hit sound.
"damagereceivers" Pick instance with UID target: Do generalized stuff, e.g. substract HP or play hit
"shuriken" Pick instance with UID source: Destroy shuriken
"playerhits" Pick instance with UID source:
---> "playerhits" is sword-> spawn damage on layer main etc.
"hitbox6" Pick instance with UID source: Destroy "hitbox6"
Etc.
The key point is to have every sub event using UID instance picking to get the desired object.
I hope this helps.
P.S.: Cool prototype!