will fix your problem, but I would make sure the sistered stud is the complete lenght of the stud that is rotted. It would not hurt to sister on both sides of the rotten wood stud. This could give you added structure.
Also, cut the studs alittle longer so that they need to be slightly hammered into place along side the rotten one.
Remove all the rotten material and go down to good wood on both ends. Make sure that a good stud is in place before you make the cut or alittle to the side so that nothing settles a bit, then knock it into its perm. spot. You might spray some straight bleach or mist some around to kill out any mold that you do not see.