Doesn't look bad wood frame-wise. I would still remove that window (obviously it is installed wrong) and check everything around and underneath it....especially behind the sheetrock on the interior side.
(Also: Where do those holes on the inside of the window sill go? The ones in your early pics?)
I would say to spray the dark areas on the wood framework with a bleach and water mix and clean it up, so it will kill any mold/ mildew. Let it all dry out.
If that window is in decent shape (Flanges are flat, those holes don't drain anywhere
, and there are no other issues with it) - You may be able to just remove it and then re-install it - but this time you can do it properly.
Often, we like to install water and ice shield-flashing under the window and wrapped up the sides about 2-3 inches directly over the wood frame sill. That way if any water get's in and pools up....this time, it won't get to the framework.
A Must: Get a good thick bead of caulking under the flange.
Also, make sure that you put about 4" wide strips of the water and ice shield over the flange edges. Make sure that you overlap them appropriately (Like Roof Shigles overlap). If you are still not sure about how to re-install the window or you replace it with a new window....
You can check a major "window brand" website for step-by-step installation instructions.
All in all, it's not a difficult repair. Again - Just be sure about the condition of that existing window. Otherwise, for a new window: take your rough opening measurements to a store and order a new window. If you do this, make sure that you order it as a "New Construction" window. Do not order it as a 'replacement' window....or you will get one without the flanges that keep it water and weather tight.