Q:

How to insert function to setImmediate with reflection

This is infinite loop:
function WithSetImmediate(target, propertyKey: string, descriptor: PropertyDescriptor) {
    descriptor.value = async () =>{
        return new Promise((resolve) =>
         setImmediate(() => resolve(Reflect.apply(descriptor.value,undefined,[]))))
    }
}

So, there is another way to do that? 
And how can i pass the function arguments? 

A:

You need to save original value into a variable and then apply that:
function WithSetImmediate(target, propertyKey: string, descriptor: PropertyDescriptor) {
    const originalValue = descriptor.value
    descriptor.value = async () =>{
        return new Promise((resolve) =>
        setImmediate(() => resolve(Reflect.apply(originalValue, undefined,[]))))
    }
}

