I am basically using this https://github.com/googlesamples/android-vision with a few changes and it works perfectly on my android device. Anyway, I would like to use it inside P
Of course it depends of your dev skills but I created myself my first plugin two months ago without being a Phonegap/Cordova expert, I'm a Java developer since 15 years but the most important thing is your motivation.
You first have to develop your basic Cordova app: https://cordova.apache.org/docs/en/latest/guide/cli/index.html
Then your ressource to create a plugin will be here: https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html
You will have to create one or few Java files as an adapter between your web app and your Jar code.
I found that the documentation was not enough for my case but I googled and used some dev blog articles and found some StackOverflow questions to help me.
Good luck!