On the older MacBook Pro models, it's not a software function that reduces power. It's actually a hardware requirement, managed by the SMC to utilize both mains and battery to get full performance. With a dead or missing battery it would actually "downclock" the CPU.
MacBooks Run Slow Without Battery*
If the battery is removed from a MacBook or MacBook Pro, the computer will automatically reduce the processor speed. This prevents the computer from shutting down if it demands more power than the A/C adapter alone can provide.
With newer MacBooks and the release of Catalina's Battery Heath Management feature, you can control (very limited, albeit) whether or not performance is affected.
However, in your case, you would actually see better performance if you removed or just disconnected your battery because the charging circuitry is using current that could otherwise be used for processing to try and charge a battery that will not hold a charge - in effect, you have a power "drain" on your computer which is compounding the issue.
You need to replace your battery with a quality unit
* Tom's Hardware, Marcus Yam, Marcus and Ngai, Amos; December 01, 2008. https://www.tomshardware.com/news/apple-macbook-pro-battery-benchmarks,6643.html