Add Animator Controller into others as Layer?

Hi, i will try to explain my idea

i have an Animator attached to my enemy with an animator controller to this. this animator controller has two layers, first to the movement of the enemy, up, down, attack etc… and the other layer has a AI logic, follow, flee, attack etc…

This works fine in my project but i would like to know if i can attach the AI layer by script from an external Animator Controller, to make one type of AI and reused in all my enemies who will need this type of AI.

i see that in UnityEditor.Animations has many options about this but dont find any documentation :frowning:

PD: i use unity 5 with State Machine Behaviour

Thx

using UnityEngine;
using System.Collections;
using UnityEditor.Animations;

public class NewBehaviourScript : MonoBehaviour {

    public AnimatorController AI;
    Animator anim;

    void Start () {
        anim = GetComponent<Animator>();
        AddLayer(AI);
    }

    void AddLayer(AnimatorController ai)
    {
        AnimatorController actual = anim.runtimeAnimatorController as AnimatorController;
        actual.AddLayer(ai.layers[0]);
        foreach(var p in ai.parameters)
        {
            actual.AddParameter(p);
        }
    }
}

this works but dont know if there exist a better way to do that or if it is a bad practice?

Thxs