How can one rotate a quaternion so that the rotation is around a plane normal?
A graphic/diagram I made below gives more detail about what exactly I am implying. Note that the tip of the quaternions in the diagram are that of the quaternions local, upwards direction, symbolizing roll (the quaternion's w component).
English describing the diagram:
The rotation is around plane normal (vector) N with amount θ. The global axes are X, Y, and Z (Y is up). The plane normal and quaternion are both in global space. Notice how the beginning and end of the operation does not use any reference to the global axes, only the plane.
The angle between the start quaternion (q) and end quaternion (q') and the plane is equal (a = a'). If you were to draw lines from the tips of the quaternions to the plane, the angles of intersection would be equal. In other words, the roll of the quaternions are preserved in relation to that of the plane.
EDIT 6/21/2020: Thanks to Theraot, this is possible simply by doing this in your favorite engine with quaternions:
quaternion qPrime = quaternion.AxisAngle(normal, θ) * q;
As Theraot states in his answer, order of multiplication does matter, and some engines may do the opposite operation compared to other engines. For Unity's Mathematics package, the above pseudo-code holds true. The formula for AxisAngle can be found by a simple google search. The following Gif shows it working while proving that all angle requirements I stated above are satisfied.