With this system you can freeze players by setting their freeze score to the duration (in ticks) of the effect.
Example : /scoreboard players set Player freeze 60 will freeze Player for 60 ticks (3 seconds)
Made in 1.12.2
Command :
https://pastebin.com/5ZY1n3Ng