That looks to me like the remnants of termite infestation not rot. You should get a professional inspection done to see if there are any active sites and then work out what needs replacing.
Advice from me on this forum is general and for guidance based on information given by the member posing the question. Not to be used in place of professional advice from people appropriately qualified in the relevant field. All structural work must be approved and constructed to the BCA or other relevant standards by suitably licensed persons. The person doing the work and reading my advice accepts responsibility for ensuring the work done accords with the applicable law.