How the A4988 might get damaged?

The A4988 5V and motor power supply inputs are independent.