If, as Ronbye assumes, you are replacing the rotten ply, you can trim the assembled plywood/laminate before installation with a router or a laminate trimmer.
If you are trying to do this in place, there is often no room for the guide plate on a router. You can put a laminate trimming bit into a drywall hole cutter - small router-like tool for carving out electrical outlets in drywall. It has a smaller guide. Watch for the torque, it can spin out of control easily.
In the end, do what areas the router/trimmer can reach then you're pretty much stuck trimming by hand - cut as close as you can with a laminate knife - and slowly file the rest away for a clean edge.
A long, finicky job!!