Multiple charge density wave states and magnetism in NdPt2Si2 against the background of its nonmagnetic analog LaPt2Si2