Jenkins 2.164.3 - programmable plugins installations for specific versions
Why not use Plugin installation manager tool?

Your alternative would be the install-plugins.sh referenced in the tool readme.md. You can explicitly list all plugins and versions or let it auto-resolve dependencies.

See also answer in S/O re:Jenkins plugins for old versions.