Create a forward vector from H and P (math help)

this works! but sadly does not suit my current situation, yes it converts Hpr into a vector, but I want to adjust a currently existing vector’s pitch by euler Pitch. but I will use this for another feature, a huge thanks for this!

EDIT: unless there is a way to replace this vector’s pitch with a currently existing vector pitch as a intercept.
EDIT2: I mean I could try this.

        euler = [math.atan2(vec.getX(), vec.getY()) * 180 / math.pi, math.asin(vec.getZ()) * 180 / math.pi]
        q = Quat()
        if intercept:
            euler[1] = interceptedNumber
        q.setHpr((euler[0], euler[1], 0))
        newVec = q.getFroward()

I but I am afraid of gimball lock during transition