Here is roughly speaking, what you need to do.
When the shift key is pressed (detect using SHIFTKEY() ), move the sword forwards (using POSITION OBJECT, if your character has an attacking animation, use PLAY ANIMATION as well). Use OBJECT COLLISION to detect the sword hitting the enemy, if they hit, decrement the lives counter.
This is a rough sketch in semi-pseudo code
Note that "Sword","Enemy" are just numbers
If Shiftkey()
Move Object Sword,1
If Object Collision (Sword,Enemy)
Dec EnemyLives
Endif
Move Object Sword,-1
Endif