One thing that happens when concrete products like stucco are in contact with regular wood is it rots it. If the wood wasn't pressure treated then the moisture gets sucked out and it deteriorates. Add weather to that and things get worse.
You could choose to replace the worst stuff and then follow some good wood preserving practices on the other stuff until it needs to be replaced. If the wood trim is on top of the stucco you could remove it, and fill damage with a matching stucco (of course it won't match exactly), but you can get close. If the stucco butts to the trim then you could also replace it with stucco up to the window frame. I had some vigas that had rotted out on a stucco house and so I cut them off, filled the holes with a similar color of stucco and then took a chip of the old stucco to the paint store and had some paint mixed that matched. I moved out of that house a few years later but it still looked good (un-noticeable).
I'm sure others here will have experience with other options.