I need to reach IK Pass box, and control the weight by time from 1 to 0. I tried GetLayerIndex and did not give me any of those options.
I don't think you are able to set the flag during runtime. You should tick the box in editor if you plan to use IK features and then during runtime use the weight to adjust behaviour.
GetLayerIndex only returns the layer index for that layer as integer. After you know it, you can use Animator.SetLayerWeight to adjust the layer weight.