Water damaged wall studs.

I just got my first home and while my girlfriend was tearing out wallpaper we discovered the shower hardware was routing water right into the wall. The whole corner of the framing is brittle or spongy. I cut out all the bad drywall. I got a drill, Hackzall, Sawzall, Circular Saw, and angle grinder. Plus PPE. If this was load bearing… it isn’t any more. Can I just cut out the bad wood and replace it?

I really would like to learn how to take care of of my own home. But everything is new to me. Thanks!