Ultimate AI 1.5 does something close to what you're asking. For example, playing Milan you can only build Italian milita if you have only built barracks. You need a tanner to get Italian spear militia. Usually you need the training building and the weaponmaker or armormaker.
Problem is, it's a global mod which changes a lot of things apart from that. If you''re curious try it from TWcenter.