replace stud that has vent pipe through it
Why do you need to replace the stud?  Unless it has rotted, you do not need to replace a stud with water damage.  Removed the damaged drywall and any other wet items and let the wood dry out before replacing the drywall.

If this is inside the bathroom, be sure you are using the right type of product.  You would not use regular drywall in a shower or bath area, you would use cement board or something similar.