To answer the way the issue should be fixed is to replace the window. That way the rotted framing can be repaired too without the window in the way or have any fear of having the window drop from trying to undermine the old framing or, if the framing is still intact, if offers access to inspect it properly.
I can see though, it will be quite costly to do.
To repair the sill will be tedious, time consuming, and after all that, still may need to replace the window after all.
You will need to start by removing completely a small portion (12-16") of the window sill to see if the shims that support the window are under the window jamb behind the sill or if the window is supported by shims under the sill itself. It would be a huge help if you removed the trim from the inside too, and if needed, cut the drywall to exposed the full rough opening to the top of the rough sill. This will be helpful on evaluating all the sill from the interior to the exterior.
If the shims are under the jamb and not the sill, (this is how it should have been set) then the fix may be simpler, and you can move on with removing the remainder of the sill. Please be vigilant on the removal process that it is complete, not a hiding splinter of wood is tucked away somewhere especially in the groove that the old sill tied into, and especially that the new sill will go there too. The screws, nails and any caulk that the old sill had holding it in place goes too. Do be certain that the window is shimmed a few spots in the middle and especially at the ends where the jambs meet in the corner.
Sometime along this process you will have a chance to inspect what you can see of the rough sill that the window sets on. If the sill is decayed, the window should really be pulled and repair the rough sill. My fear is the sill is shot since the window has been repaired before and from the looks of it now the soft decayed wood will let rainwater pass through to wet the framing below it and start rot there.. To have this intact is important in the replacement process.
A sketch will be good for me to issue on the reassembly. If you think you still want to tackle the repair I will try to figure out how to get a drawing to show up here. I am new here and I have yet to figure out how to do some things. The sketch will take time too, I am familiar with Sketch Up, which I have seen used in the forums before.
Just to let you know, this is just getting to the tedious part, what I mention so far is easy in comparison, but this is the type of stuff I enjoyed doing at work when I had the chance.
I added a edited pic that you posted earlier to show how the various parts will fit in their final position. The labeling on the pic should be self explanatory for the most part.
Some details that would not fit on the pic,
the recut of the rib on the new sill needs to make the rib narrower by 1/8 inch, to keep it the same size will make it nearly impossible to get it to engage to matching groove in the jamb. I tried to set a sill to a window on the jobsite before the window was set, I could not get it to go in without a recut. Any slight bow in the sill would drive anybody crazy to get it to set. The rib is important to act as a water stop, so it really so stay intact, just a little narrower
Before all this is set in place and while this cutting is being done, make sure you get enough sill to use as test pieces, say 4 ft. extra, to make a number of 1 ft. test pieces. If it doesn't work mock up another.
Once all is going together properly, set the screws too, but do not caulk it yet, you must get it to fit first completely before you add caulk. When caulk is added between the sill and jamb to bed the sill, that will change everything enough to make it tough to reset the screws. I don't know why, it just does. I have done this stuff before and it is easy without the caulk, but as soon as caulk is added it gets really tough.
To get the angle of the screws to come out of the sill in the exact spot you need, start the drilling from the side the screw will come OUT of. This spot is in front of the rib and just passing by the inside corner of the sill out of the bottom of the sill. Where it comes out is not that important as long as it is outside of the stucco face. The most important thing is the sill is tight to the jamb with caulk in place and the screws have the least angle possible to draw the sill even tighter.
If you caulked it and there's still a leak, you didn't caulk the whole gap. Air isn't going to come through silicone caulk. For such a small gap, expanding foam is overkill and may do more harm than good if it expands too much and widens the gap, which could cause the window to start sticking.
Another possibility is that there are additional gaps and holes in the area. Windows--especially old ones--are notorious sources of air leaks. Caulk the heck out of every gap you can find. If the windows have wood trim, caulk that to the drywall and the windows using color-matched or clear caulk. If you really want to do a thorough job, you can temporarily remove the trim and seal the exposed area between the rough opening and the window with expanding foam--be sure to get the kind that Tester101 recommended for this--the low-expansion window & door foam--and then replace the trim. And if your windows are of the very old variety that have poor seals, add stick-on compressible foam gaskets to the sliding sashes that contact the frame. You'd be surprised how much that can help.
Best Answer
The bottom piece of your wood window is called the sill.
I had to replace some rotted sills in my home an had a piece leftover Here are some pictures of it to show the profile.