Several different methods can be used as best applies to each area:
Mask work area.
Scrape out all damage from affected wood. Seal surrounding remaining wood with “Wood Hardener”. Fill void with “Bondo”, sand smooth. Fill small voids with polyether sealant.
Cut off damaged section of affected wood. Seal edges of existing remaining wood with “wood hardener”. Repair moisture barrier. Install new wood section with wood glue and screws. Fill seams with polyether sealant. Sand for a smooth transition.
Remove entire affected board. Repair moisture barrier. Install new board. Shim if necessary to meet with miters or adjoining boards properly.