If upgrading the CPU is the option you choose, I personally think this would be the best course of action - assuming the source of this "used" processor can be trusted. A new Ryzen 7 1700 currently costs $280 at Newegg - a fair price but I just don't feel putting that kind of money in that computer is that good of an investment.
While the Ryzen 7 1700 is likely to provide overall computer performance, a better graphics card is more likely to improve frame-rate specifically - your stated requirement. But as noted, a better graphics card may require a PSU upgrade too. And now you are spending even more money than you would with the upgraded CPU.
The specs say "ATX" power supply - my problem there is I don't really trust HP (or Dell or Acer) when it comes to
total compliance with the "ATX" Form Factor standard. If not totally ATX compliant, that means you cannot simply buy any standard EVGA or Seasonic (as examples) PSU and assume it will connect properly to your motherboard.

You will have to do some further research and if not 100% totally compatible with the ATX standard, you will have to upgrade the PSU with another HP provided "proprietary"

supply. And note proprietary = more money.
Another upgrade option not mentioned thus far is RAM. How are your RAM slots currently populated? If you currently have 1 x 8GB of RAM in 1 slot, you should have another slot free. According to the
Crucial Memory Finder, you can double your RAM to 16GB for just $37. If me, that is all the money I would throw into that computer. While 8GB is already a nice chunk and often considered the sweetspot for most users, bumping up to 16GB should provide a noticeable over-all performance boost on many tasks. If you currently have both slots occupied with 2 x 4GB, you will have to toss those and replace with all new sticks. But still, according to Crucial, that is just $74, less than a CPU or new graphics card. Adding a second stick of RAM will not be a problem with your current PSU either.
What you are seeing it a common problem with just about all factory built computers from the big makers - very limited upgrade options. For this reason, I also recommend just hanging on to your money until you can build up the budget for a new computer - one you build yourself (not nearly as hard as it sounds) or a custom built, "totally ATX compliant" computer from a trusted local computer shop.