I know it isn't exactly helpful.... but this frustration is so normal for that age. He is increasingly aware of the world around him, and his own feelings, but without verbal skills it is so hard for them to "express" what they are thinking/feeling.
I also found that I was using the word "NO" a lot. I just became more concious of saying it less. We can get the message across without saying it. "We do NOT hit our friends" is the same as "NO hitting".
I would do exactly what you are doing, in staying consistent with the consequences for hitting others or throwing things at others. Honestly, if he is hitting himself, I wouldn't worry too much about it. He will figure out soon enough that it has zero effect. I might just say "Oh, ouch. I don't think you should hit yourself".
I would bet you ten to one that as his language develops, this behaviour will fade away. Good luck!