Yamaha's are good bikes. I really like the Yamaha motor of my 2016 Haibike AllMtn.
That said, with any used ebike you should be concerned with the health of the battery, the most expensive part that consumers can replace. (Yamaha won't sell motors directly to consumers.) Since the charger is broken, I assume you cannot charge the battery to see if it will even hold a charge. And even if you found a way to charge the battery, that alone will not tell you its state of health.
I think you need to figure you would need to replace the battery and get a new charger, plus other things like a new tube, perhaps a new tire, perhaps a new chain, etc. I would add $1,000 to $2,000 to the cost of the used bike to make it rideable. A new one is about $3,000 and comes with a warranty. Draw your own conclusions.