It's very possible that the "rot" was caused by condensation on and around the window. Most RV manufacturers install a wood frame around each window opening to support the window frame and hold the screws. The only way to determine the extent of the moisture problem is to take out the window and inspect the wood frame. I would also call the manufacturer to see if they can offer some insight. In terms of the cause being a leak (instead of condensation), this can be alleviated with a few tubes of caulking and a trip to the roof. There might also be some infiltration at the top of the window so check it out.
Bottom line? It's a manageable situation. Remove the window and check out the wood. Replace any damaged pieces and put the window back on with new sealant. Then do a search around the entire exterior of your rig and look for any cracked sealant. My guess is that you'll resolve the problem with a few days work. Best of luck and let us know how you make out.
2004 Winnebago Brave 34D with the usual add-ons