Just found the solution today
Basically the goal is to scan leases and making them static then adding some rate limit and putting them to IP binding as bypassed.
:foreach i in=[/ip dhcp-server lease find host-name~"D-"] do={
:local host [/ip dhcp-server lease get $i host-name];
:local ip [/ip dhcp-server lease get $i address];
:local date [ /system clock get date ];
:local mac [/ip dhcp-server lease get $i mac-address];
:foreach binding in=[/ip hotspot ip-binding find address=$ip] do={
/ip hotspot ip-binding remove $binding;
}
/ip hotspot ip-binding add type=bypassed mac-address=$mac address=$ip comment=$host;
:log info ($mac. " ".$dynamicHOST." ".$date." Done");
}
/ip dhcp-server lease
:foreach i in=[/ip dhcp-server lease find host-name~"D-"] do={
make-static $i
set $i rate-limit=10M/10M
set $i comment=[/system clock get date]
}