Slotting disc will do the job if it will fit inside the cavity. Various ways to do the code but easy way is to treat it like an end mill following a profile path with a DOC to suit slot disc and use Diamater offset for the under cut depth.