Prune tree fruit worms
Did it look like the attached photo? Most likely your are talking about damage from spotted wing drosophila (SWD). The pest can only attack plums when they become ripe. In plum, monitoring for the pest should begin when fruits begin to change color.
There are some treatment suggestions in the plum pest management guide: https://catalog.extension.oregonstate.edu/sites/catalog/files/project/pdf/em8362.pdf
Also general info in the PNW Insect management Handbook (including monitoring info): https://pnwhandbooks.org/insect/emerging-pest-spotted-wing-drosophila-berry-stone-fruit-pest