Since you are manipulating the gradients, the optimizer will see these new gradients in its step function and will use them to update the corresponding parameter.
Let me know, if I misunderstood the question, please.