So I finally figured it out and thought that maybe I should answer my own question and hopefully help someone with the same problem.
Turns out its pretty simple actually. After getting a quaternion from the basis of your object , you just create another quaternion representing another rotation and multiply it with your first quaternion then change it to a basis and assign it back to your object.