Probably your having an issue, with the hitflags (check the docs for detailed info)
For the second issue, you will have to check for the anims, and the chamgestates, probably you are changing to ken´s moves or anims
About AI, I suggest you, to first learn all the basic coding, because when you code an Ai, you will need yo understand most of the parameters...for example
;triggerall, means that it can start checking the triggers, only when all of the triggerall statements are true, these will limit the move with all your desire parameters, I used when I want, and when I dont want using !=
[State AI, Drill]
type = ChangeState
triggerall = var(0)
triggerall = statetype = S
triggerall = statetype != A
triggerall = statetype != C
triggerall = p2movetype != A
triggerall = p2statetype != C
triggerall = stateno != [1003,1004]
triggerall = prevstateno != [1003,1004]
triggerall = !Numhelper (1005)
triggerall = p2bodydist y =[-20,20]
triggerall = !Numhelper (4800)
triggerall = p2statetype !=L
; trigger1, will make it activate when the enemy is from 30 to 180 pixels away from me, and when the random value ,which goes from 0 to 999, takes a value from 800 to 820, the random is used, to make the char a little bit unpredictable
trigger1 = p2bodydist x = [30,180]
trigger1 = random = [800,820]
;trigger2 is a combo, it will activate if you are in statedef 240 or you just have came out of that state, and the move has hit the opponent , the time is used to let the char has time to exit the state 240.
trigger2 = ((prevstateno = 240)||(stateno =240))&& movehit && time >=10
trigger2 = random = [400,420]
;trigger3 its used, to make the attack, when the enemy is moving (including jumping), and the enemy is a little bit away from you, and the enemy is not attacking, and he isnt in a hitstatedef, also the enemy doesnt have a projectil, or a helper
trigger3 = p2bodydist x >= 57 && enemy, vel x !=0 && random <=50
trigger3 = p2bodydist y =[-40,40]
trigger3 = (p2movetype != H || p2movetype !=A )&& enemy,NumProj = 0 && enemy,NumHelper =0
value = 1003 ; statedef of the drill attack
as you can see its not hard, but you need to understand what you are doing, and you need to have a clear idea on when exactly do you want the move to activate