not so much an optimization, but if you change Img to be a function parameter and return the result of the LoadImage function rather than assigning it directly, you have yourself a reusable function
(actually code may vary)
CreateShapeFromMask:TImage(img:TImage)() End Function myPlayer.DamageImage = CreateShapeFromMask(playerImage) Monster1.DamageImage = CreateShapeFromMask(monsterImage1)
(actually code may vary)