The difficulties with your examples arise partly from the use of the verb come as well as with the tenses.
It's clear that you are speaking in Example 1 after you had gone to the party. You are no longer at the party. Therefore you need to say that your friend went to the party. If you were still at the party, your friend would have come to the party.
That's to say, you use come to mean towards me and go to mean away from me or in some other direction.
This is slightly complicated in your examples because you are imagining yourself at the party when you write them.
To avoid this difficulty, you might write:
If I had not gone to the party, I would not have met my friend who arrived there/showed up there/turned up there/was also present.
Example 2 is more complicated. You are writing it before you decide whether to go to the party:
If I did not go to the party.....
You conclude that:
I would not meet my friend
which is perfectly correct
But because you are not at the party, which you may or may not attend, you need to conclude:
I would not meet my friend who is going there/going to be there/will be there/will also be there, etc
But you cannot say: who came there because you are not there yourself and because this uses the past tense to describe an event that lies in the future for you.