If you are going down the Tasker route you could just turn a charger on and off using an API call. An alternative would be to create a virtual battery device (I use the @TAustin driver) and update that using the API. I favour the latter as it gives you the battery and power source in SmartThings where it really ought to be already.
Here is an example of an HTTP Request in Tasker. It requires knowledge of the device ID in UUID form, and also a suitably scoped Personal Access Token for the bearer authorization.