IF the existing subfloor is okay and just too springy, 5/8" is way overkill. You could use 3/8" plywood and glue it down with PL400 construction adhesive and screw it as well to bring the layers together. 1/4" plywood may work just fine too as long as it's glued and screwed. Some people report that floors feel springy even on new units which is because of the joist span and inadequate subfloor thickness.
If you change the floor thickness and the existing toilet flange remains where it is, it is critical to raise the flange so that a standard rv toilet gasket can be used. Always use a new gasket if you pull a toilet out. Get a "closet flange extender" like in the photo. You can stack these if needed. It's also important that you do not over or under-compress the gasket and maintain the original amount of compression on the gasket. Not sure what the flange extender thickness is (3/8"?), but I would add plywood thickness to match the thickness of the extender. If you add new flooring with thickness to it, like vinyl plank laminate, don't forget to take that into account as well.
Don't use a wax ring unless it's a last resort as it can get too warm inside an RV and can soften the wax too much.
*IF* you have rotten subfloor material, then it's a different story and you have more work to do and you will need to cut out and remove the rotten material. In addition to what Gdetrailer describes, you can install a patch section differently as well. Providing the existing subfloor material is okay, when you cut the old out, leave about 1.5" of overhang over the joists. Then slip 2" wide (or more) strips of plywood under the existing subfloor around the entire perimeter and glue and screw it. The you will have something to attach the new patch piece of subfloor to. This way, you can leave the floor joists untouched. If the subfloor is rotted/disintegrated, as said, you need to fix any water leakage that caused it.
If the subfloor is shot right up to the vanity, if your vanity is not attached to a wall on one end, you may be able to remove it by removing the screws that are typically screwed through 1x1 strips inside the vanity holding it to the wall and subfloor. You may have to remove the shelf by pulling upwards on it to pull the staples away to get access. Removing the vanity may make it easier to fix the floor and also make for a better job.
If you do not have an enclosed underbelly, there's always the possibility of doing some of the repair work from underneath.