I've repaired a fair amount of speaker drivers.
This might be the foam you need as your woofers surrounds look to be reverse mount. Some measurements of the cone/frame diameter, a cross section of what foam you have left should get you close. Reverse mounts can be tricky but some pretty much self center/self form on the cone side. Few practice dry runs should get you a feel for it if you are the least bit crafty. At this point, you really don't have anything to lose, if for some reason the other suggestions here can't be met.
Here's a youtube video shows how to refoam a JBL rear mount.
Also, some towns/cities will have speaker exchange/repair outlets that will do it for you.