And why did the author of Hebrews quoted from this verse if it was badly translated? I'd really appreciate any help I could get because I'm having difficulties with this. Thanks
The Targum which is an Aramaic translations of the Hebrew OT, which were written by Jews long before Jesus was born and which was read in all the Jewish synagogues before during and after the tine of Jesus, translated psalm 45:6, "Your throne, of honor, YHWH (YAHWEH) is forever and ever."
It is clear that psalm 45:6 is a messianic prophecy referring to a divine king to come. And the psalm 45:6 we have in our bible is not a mistranslation. Hope this can help.
Psalm 45:6 was not badly translated, in my opinion. It's true that sometimes the Masoretic text which the KJV Old Testament comes from doesn't match the New Testament author's quotation (in which case it either matches the Septuagint, or other sources no longer extant) but happily this is one place where the Old Testament jibes almost perfectly with its quotation in the New Testament.
Psalms 45:6 Thy throne, O God, is for ever and ever: the scepter of thy kingdom is a right scepter.
Hebrews 1:8 But unto the Son he saith, Thy throne, O God, is for ever and ever: a scepter of righteousness is the scepter of thy kingdom.
The Dead Sea Scrolls, according to my studies, give credence to the Masoretic Text's accuracy in that around 60% of Old Testament scripture found at Qumran conforms to that text type. So I think "O God" can reasonably be assumed to be translated correctly in both instances here, the testimony of two witnesses being ostensibly true.